"/a" is not "/a" ?

Robert Kern robert.kern at gmail.com
Sun Mar 8 00:44:45 CET 2009

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

More information about the Python-list mailing list