This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author sree314
Recipients mark.dickinson, rhettinger, sree314, tim.peters, veky
Date 2020-11-02.17:14:37
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1604337277.53.0.972188084534.issue42210@roundup.psfhosted.org>
In-reply-to
Content
Thanks, all. I just wanted to know if this was a deliberate decision or an oversight. It also took me a while to realize it washex, and not fromhex.

That allows the current behaviour to be easily worked around in Python code, and a backwards compatible optional parameter to hex() might allow -nan in the future without breaking existing software.

Surprisingly, the standard does allow this [but this may not have been the intent] -- (Section 6.2) "Recognize that format conversions,
including conversions between supported formats and external representations as character sequences,
might be unable to deliver the same NaN." The conversion to character sequences text is key since I'm using a test harness written in Python that writes out and reads back text files containing float data.

Section 6.3 in the standard also adds more details on when the sign bit in NaNs is relevant.
History
Date User Action Args
2020-11-02 17:14:37sree314setrecipients: + sree314, tim.peters, rhettinger, mark.dickinson, veky
2020-11-02 17:14:37sree314setmessageid: <1604337277.53.0.972188084534.issue42210@roundup.psfhosted.org>
2020-11-02 17:14:37sree314linkissue42210 messages
2020-11-02 17:14:37sree314create