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 mark.dickinson
Recipients congma, mark.dickinson, rhettinger, tim.peters
Date 2021-03-13.10:34:54
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
> We could make this problem go away by making NaN a singleton.

That could work, though we'd annoy anyone who cared about preserving NaN payloads and signs in Python. I don't know if such people exist. Currently the sign is accessible through things like math.copysign, and the payload through struct manipulations (though on most platforms we still don't see the full range of NaNs: signalling NaNs are quietly silenced on my machine).

We'd also want to do some performance checks: the obvious way to do this would be to have an "is_nan" check in PyFloat_FromDouble. I'd *guess* that a typical CPU would do a reasonable job of branch prediction on that check so that it had minimal impact in normal use, but only timings will tell for sure.
Date User Action Args
2021-03-13 10:34:54mark.dickinsonsetrecipients: + mark.dickinson, tim.peters, rhettinger, congma
2021-03-13 10:34:54mark.dickinsonsetmessageid: <>
2021-03-13 10:34:54mark.dickinsonlinkissue43475 messages
2021-03-13 10:34:54mark.dickinsoncreate