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

mattip report at bugs.python.org
Tue Apr 10 11:13:06 CEST 2012


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

The pickle output has the sign-bit set. Ignoring the sign-bit, it is unpickled correctly. However math.copysign using this value will now return minus on platforms where copysign(3., float('nan')) is known to work.

Perhaps the whole can of worms should not have been opened in the first place.
Another solution would be to raise a ValueError if copysign(x, float('nan')) is called...

----------

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


More information about the Python-bugs-list mailing list