[Python-ideas] Disallow orderring comparison to NaN

Robert Kern robert.kern at gmail.com
Fri Apr 29 03:40:15 CEST 2011


On 4/28/11 11:12 AM, Alexander Belopolsky wrote:

> The problem with faithfully implementing IEEE 754 in Python is that
> exceptions in IEEE standard don't have the same meaning as in Python.
>   IEEE 754 requires that a value is computed even when the operation
> signals an exception.  The program can then decide whether to
> terminate computation or propagate the value. In Python, we have to
> choose between raising an exception and returning the value.  We
> cannot have both.  It appears that in most cases IEEE 754 "INVALID"
> exception is treated as a terminating exception by Python and
> operations that signal INVALID in IEEE 754 raise an exception in
> Python.

This is not true. In fact, in most cases that issue an INVALID exception are 
passed silently in Python. See my response to Guido elsewhere in this thread for 
a nearly complete list.

-- 
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-ideas mailing list