This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ahrvoje
Recipients ahrvoje, eric.smith, mark.dickinson
Date 2016-04-17.22:27:48
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1460932069.08.0.253722234387.issue26785@psf.upfronthosting.co.za>
In-reply-to
Content
Regarding NaN sign bit, IEEE-754 states:

"Note, however, that operations on bit strings—copy, negate, abs, copySign—specify the sign bit of a NaN result, sometimes based upon the sign bit of a NaN operand. The logical predicate totalOrder is also affected by the sign bit of a NaN operand."

So NaN sign bit information is used in the standard itself (section 5.10.d):

1) totalOrder(−NaN, y) is true where −NaN represents a NaN with negative sign bit and y is a
   floating-point number.
2) totalOrder(x, +NaN) is true where +NaN represents a NaN with positive sign bit and x is a
   floating-point number.

This fact alone implies the importance of its round-trip safety. I believe the quote you picked states this information doesn't have universal (standardized) meaning, not it is not important or used at all. It is reasonable to assume some will need to preserve it.

There are also some real-life usages, similar as signed zero, in determining the correct complex plane branch cut:
http://stackoverflow.com/questions/8781072/sign-check-for-nan-value
http://docstore.mik.ua/manuals/hp-ux/en/B2355-60130/catan.3M.html
catan(inf + iNAN) => π/2 + i0; catan(inf - iNAN) => π/2 - i0;

MSVC 2015 and MinGW-W64 v4.9.2 output (source below) for '-nan' values are:

MSVC:      -nan(ind)
MinGW-W64: -1.#IND00


#include <stdio.h>

int main()
{
    double x = 0.0;
    x = - x / x;
    printf("%lf\n", x);

    return 0;
}
History
Date User Action Args
2016-04-17 22:27:49ahrvojesetrecipients: + ahrvoje, mark.dickinson, eric.smith
2016-04-17 22:27:49ahrvojesetmessageid: <1460932069.08.0.253722234387.issue26785@psf.upfronthosting.co.za>
2016-04-17 22:27:49ahrvojelinkissue26785 messages
2016-04-17 22:27:48ahrvojecreate