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) -1.0 This is correct. Also proves the value contains the sign information. >>> repr(x) nan Not correct. Should be '-nan'. ---------- components: Interpreter Core messages: 263576 nosy: ahrvoje priority: normal severity: normal status: open title: repr of -nan value should contain the sign type: behavior versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue26785> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com