NaN comparisons - Call For Anecdotes

Marko Rauhamaa marko at pacujo.net
Thu Jul 17 21:10:08 CEST 2014


Chris Angelico <rosuav at gmail.com>:

> numerical calculations might overflow to +inf or -inf, and then
> further calculations can result in a nan, etc, etc. Those are the
> sorts of examples that you'd find among SciPy users and such.

There is some inconsistency.

Mathematically, there are undefined operations, for a good reason.
That's because the limits are not unambiguous and that's why 0/0, 0**0,
1/0 and inf-inf are undefined.

Why 0/0 results in an exception but inf-inf = nan, I don't see a
justification.


Marko



More information about the Python-list mailing list