On Sat, Sep 12, 2020 at 12:56:25PM -0700, Christopher Barker wrote:
Is there any guarantee in Python or the C spec, or the IEEE spec that, e.g.:
1e10000
would create an Inf value, rather than an error of some sort?
IEEE-754 requires that float literals overflow to infinity.
I don't have a source for this (I cannot find a copy of the IEEE-754 standard except behind paywalls) but I have a very strong memory of either Tim Peters and Mark Dickinson stating this, and I believe them. (If either of them are reading this, please confirm or deny.)
And there's still NaN -- any way to get that with a literal?
If you have an INF, then you can generate a NAN with `INF - INF`.
In general though, Python doesn't support generating the full range of NANs with payloads directly.