Re: special floats generate incorrect C code when used as compile-time constants
Greg Ewing <[email protected]>
| Newsgroups | gmane.comp.python.pyrex |
|---|---|
| Message-ID | <[email protected]> |
Stefan Behnel wrote:
> As of 2.6, float('inf') and float('nan') will be guaranteed to work
Does it also provide a way of testing whether a value
is an inf or nan?
I tried this on MacOSX using 2.3:
>>> x = float('nan')
>>> y = float('nan')
>>> x == y
True
But isn't that wrong? Aren't nans supposed to compare
unequal to anything else, including themselves? What
does 2.6 do here?
--
Greg