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 <1615631694.79.0.4819001945.issue43475@roundup.psfhosted.org>
In-reply-to
Content
> 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.
History
Date User Action Args
2021-03-13 10:34:54mark.dickinsonsetrecipients: + mark.dickinson, tim.peters, rhettinger, congma
2021-03-13 10:34:54mark.dickinsonsetmessageid: <1615631694.79.0.4819001945.issue43475@roundup.psfhosted.org>
2021-03-13 10:34:54mark.dickinsonlinkissue43475 messages
2021-03-13 10:34:54mark.dickinsoncreate