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 sree314
Date 2020-10-30.16:04:29
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1604073869.82.0.718371202647.issue42210@roundup.psfhosted.org>
In-reply-to
Content
float.hex(float.fromhex("-nan")) returns 'nan'.

PyOS_double_to_string seems to check only if it is a NaN, but ignores the sign (unlike its handling of inf a few lines below):

<https://github.com/python/cpython/blob/e9e7d284c434768333fdfb53a3663eae74cb995a/Python/pystrtod.c#L903>

Issue 5981 (https://bugs.python.org/issue5981) added the ability for fromhex to recognize -nan, but hex should probably have been updated at the same time.

Encountered when testing float implementations.
History
Date User Action Args
2020-10-30 16:04:29sree314setrecipients: + sree314
2020-10-30 16:04:29sree314setmessageid: <1604073869.82.0.718371202647.issue42210@roundup.psfhosted.org>
2020-10-30 16:04:29sree314linkissue42210 messages
2020-10-30 16:04:29sree314create