[issue22590] math.copysign buggy with nan under Windows

Antoine Pitrou report at bugs.python.org
Thu Oct 9 22:00:22 CEST 2014


Antoine Pitrou added the comment:

Also, the fact that we support float('nan') and float('-nan') as producing different bit patterns means we should perhaps produce the right sign bit for each (it seems that's the problem here).

>>> import struct
>>> struct.pack("d", float("nan"))
'\x00\x00\x00\x00\x00\x00\xf8\xff'
>>> struct.pack("d", float("-nan"))
'\x00\x00\x00\x00\x00\x00\xf8\x7f'

----------

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


More information about the Python-bugs-list mailing list