[issue14521] math.copysign(1., float('nan')) returns -1.

mattip report at bugs.python.org
Sun Apr 8 02:21:58 CEST 2012


mattip <matti.picus at gmail.com> added the comment:

Sorry for the garbage c code, the comment however is correct: Py_NAN is created with the sign bit set (on windows), and then _copysign on windows uses the sign bit to determine the output, which results in the wrong answer.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14521>
_______________________________________


More information about the Python-bugs-list mailing list