osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Why float('Nan') == float('Nan') is False


"Avi Gross" <avigross at verizon.net>:

> A NaN is a bit like a black hole. Anything thrown in disappears and
> that is about all we know about it. No two black holes are the same
> even if they seem to have the same mass, spin and charge. All they
> share is that we don't know what is in them.

Then, how do you explain:

   >>> float("nan") != float("nan")
   True

Why's that not False?


Marko