STINNER Victor <vstin...@python.org> added the comment:

Python/dtoa.c uses:

/* Standard NaN used by _Py_dg_stdnan. */

#define NAN_WORD0 0x7ff80000
#define NAN_WORD1 0

/* Return a 'standard' NaN value.

   There are exactly two quiet NaNs that don't arise by 'quieting' signaling
   NaNs (see IEEE 754-2008, section 6.2.1).  If sign == 0, return the one whose
   sign bit is cleared.  Otherwise, return the one whose sign bit is set.
*/

double
_Py_dg_stdnan(int sign)
{
    U rv;
    word0(&rv) = NAN_WORD0;
    word1(&rv) = NAN_WORD1;
    if (sign)
        word0(&rv) |= Sign_bit;
    return dval(&rv);
}

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue46640>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to