[issue1678380] 0.0 and -0.0 identified, with surprising results

Mark Dickinson report at bugs.python.org
Sat Oct 24 16:19:34 CEST 2009


Mark Dickinson <dickinsm at gmail.com> added the comment:

Mancausoft:  is this little-endian, OABI?

If so, then I think I know  what the problem is:  the disambiguation code 
in compile.c looks at the first and last bytes of the double to 
distinguish 0.0 and -0.0;  for mixed-endian (aka little-endian, swapped 
words) doubles this will fail.

The solution is to use copysign instead.

----------

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


More information about the Python-bugs-list mailing list