[docs] [issue12211] Better document math.copysign behavior.

Mark Dickinson report at bugs.python.org
Sun Feb 16 17:21:15 CET 2014


Mark Dickinson added the comment:

More examples, showing that `y` is not ignored when `x` is a NaN.

>>> result1 = copysign(float('nan'), 1.0)
>>> result2 = copysign(float('nan'), -1.0)
>>> copysign(1.0, result1)  # result1 is a NaN whose sign bit is cleared.
1.0
>>> copysign(1.0, result2)  # result2 is a NaN whose sign bit is set.
-1.0

----------

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


More information about the docs mailing list