[issue11949] Make float('nan') unorderable

Alexander Belopolsky report at bugs.python.org
Sat May 21 21:36:07 CEST 2011


Alexander Belopolsky <belopolsky at users.sourceforge.net> added the comment:

On Sat, May 21, 2011 at 3:18 PM, Mark Dickinson <report at bugs.python.org> wrote:
>
> Mark Dickinson <dickinsm at gmail.com> added the comment:
>
>> Table 5.2 referenced above lists 10 operations, four of which (>, <,
>> >=, and <=) are given spellings that are identical to the spellings of
>> Python comparison operators.
>
> Yep, those are included amongst the "various ad-hoc and traditional names and symbols".  So what?
>  It's still the case that IEEE 754 gives no requirement (or even recommendation) for how either of
> 'compareQuietLess' or 'compareSignalingLess' should be spelt in any particular language.

IEEE 754 is not a standard that is directly applicable to the design
of programming languages.  For example, it is completely silent on the
issue of which operations should be implemented as infix operators and
which as functions.  Still, to the extent it is appropriate for IEEE
754 to say so, I think it says that '<' is 'compareSignalingLess'.

IEEE 754 can only be a guide for language design and not a
specification.  However, the decimal module, which was explicitly
designed for IEEE 754 compliance, makes order comparison operators
signaling.  What is the reason to make them quiet for floats other
than backward compatibility?  Note that backward compatibility is
likely not to be an issue if we make nan comparisons generate a
warning (possibly even off by default) rather than error.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11949>
_______________________________________


More information about the Python-bugs-list mailing list