[New-bugs-announce] [issue26785] repr of -nan value should contain the sign
report at bugs.python.org
Sat Apr 16 14:44:53 EDT 2016
New submission from Hrvoje Abraham:
repr of -nan value should contain the sign so the round-trip could be assured. NaN value sign (bit) could be seen as not relevant or even uninterpretable information, but it is actually used in real-life situations, the fact substantiated by section 6.3 of IEEE-754 2008 standard.
>>> from math import copysign
>>> x = float("-nan")
>>> copysign(1.0, x)
This is correct. Also proves the value contains the sign information.
Not correct. Should be '-nan'.
components: Interpreter Core
title: repr of -nan value should contain the sign
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6
Python tracker <report at bugs.python.org>
More information about the New-bugs-announce