On 2009-03-07 08:14, Christian Heimes wrote:
Steven D'Aprano wrote:
Yes. Floating point NANs are required to compare unequal to all floats,
including themselves. It's part of the IEEE standard.
As far as I remember that's not correct. It's just the way C has
interpreted the standard and Python inherited the behavior. But you may
proof me wrong on that.
Mark, you are the expert on IEEE 754.
Steven is correct. The standard defines how boolean comparisons like ==, !=, <,
etc. should behave in the presence of NaNs. Table 4 on page 9, to be precise.
--
Robert Kern
"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
-- Umberto Eco
--
http://mail.python.org/mailman/listinfo/python-list