Re: Floats and NaNs

2007-12-03 Thread Robert Kern
too > bogged down with implementation specifics? A solution I guess > would be to do something like > > my_float = float("nan") > If str(my_float) == "nan": > doSomething() > > But that's awful! > > Any help or reasons why the functionalit

Floats and NaNs

2007-12-03 Thread Dalton, Tom
Hi, Is there any way to detect if a float is NaN in Python 2.4? I can pretty much understand why float("nan") == float("nan") -> False but I then expected there to be an isnan() function, perhaps provided by the maths module. I understand a lot of the floating point behaviour is implementation-