[Python-Dev] decimal.py: == and != comparisons involving NaNs

Guido van Rossum guido at python.org
Tue Nov 10 00:20:29 CET 2009


On Mon, Nov 9, 2009 at 2:51 PM, Terry Reedy <tjreedy at udel.edu> wrote:
> This also suggests to me that nan should be a singleton, or at least that
> the doc should recommend that programs should make it be such for the
> program.

The IEEE std disagreed -- there's extra info hidden in the mantissa
bits. And the Python float implementation makes it pretty impractical
to do this at the application level since x+y will generate a new
NaN-valued float object each time it is called (if the outcome is
NaN).

-- 
--Guido van Rossum (python.org/~guido)


More information about the Python-Dev mailing list