On Fri, Sep 11, 2020 at 10:19 AM Guido van Rossum firstname.lastname@example.org wrote:
While one may argue that writing `1e1000` is not an "arithmetic operation", certainly it's certainly not "casting strings to floats", and it's the simeplest way of producing `inf` in a pinch (in theory it's not portable, but I think "in a pinch" means you don't care about that).
For 128-bit versions of Python you'd need 1e4933. For 256-bit, 1e78914. But those work fine on 32-bit or 64-bit also.
I don't actually understand why Stephen made this claim about arithmetic
operations, since inf and nan exist *exactly* because arithmetic operations may produce them. And you don't need to involve pi either, just `1e300 * 1e300` does it.
Yeah, pi was irrelevant in my example. It's just something from my writing for hypothetical code that does stuff with 22/7 vs. with pi to see how different they are.