Peter Maas wrote: > As far as I know NaN is th only value that yields false when compared > to itself. This leads to > > def isNaN(x): > return (x == x) == False That is not portable: Python 2.3.3 (#1, Jan 3 2004, 13:57:08) [GCC 3.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> nan = float("nan") >>> nan != nan False Peter