Robert Kern wrote:
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.


The rationale behind the standard was because NaN can be returned by many distinct operations, thus one NaN may not be equal to other NaN.
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to