On Mon, Jul 6, 2020 at 2:15 AM David Mertz <me...@gnosis.cx> wrote: > > This is a digression, but does anyone have a nice example IN PYTHON of > arriving at a NaN without going through infinity. I think Julia is right and > Python is wrong about '0/0', but as things are, that's not an example. >
Not sure why "without going through infinity" is relevant, but you can always just use float("nan") to get one, and I'm sure there are other calculations that result in nan. It's just that 0/0 (like any other operation that involves division by zero, including 0**-1) immediately raises, rather than silently returning a nan. ChrisA _______________________________________________ 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/YZBMLNWSJLGG7ZNTRZ4YKOCALUTXDLNQ/ Code of Conduct: http://python.org/psf/codeofconduct/