On Fri, Sep 11, 2020 at 1:10 PM David Mertz <me...@gnosis.cx> wrote: > On Fri, Sep 11, 2020 at 8:58 AM Guido van Rossum <gu...@python.org> wrote: > >> What's wrong with 1e1000? >> > > As a spelling of "infinity" generically, or just as an example of an > "arithmetic operation"? > > On the latter, I didn't use that just because it feels sort of like a > "cheat" rather than an "operation." I.e. my longer example started out > with some "reasonable" numbers, but wound up tripping into inf and nan. >
Presumably this is all meant to counter Stephen Turnbull's claim: inf and nan only exist in Python the > language (including builtins) via casting strings to floats (there are > no arithmetic operations that produce them). > 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). 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. -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my pronoun here?)* <http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-change-the-world/>
_______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/JXKM7KQY3BVTYB7H3GNGJD427SUG2JJK/ Code of Conduct: http://python.org/psf/codeofconduct/