[Python-Dev] Re: cmp(x,x)

Casey Duncan casey at zope.com
Fri May 21 15:37:08 EDT 2004


On Fri, 21 May 2004 15:21:09 -0400
"Tim Peters" <tim.one at comcast.net> wrote:

> [Armin Rigo]
[..]
> NaN comparison is a red herring not only because Python doesn't have a
> sane story in any area involving NaNs, but also because the 32
> possible 754 comparison predicates can't be mapped onto 6 operator
> symbols.  Note that in C99, the infix C relational operators raise an
> exception (754's "invalid operation") when applied to a NaN, and C99
> adds a pile of new macros for non-exceptional NaN comparison (my
> favorite is the fetchingly named"islessgreater(x, y)" -- which "is
> similar to (x) < (y) || (x) > (y); however, islessgreater(x,y) does
> not raise the invalid exception when x and y are unordered (nor does
> it evaluate x and y twice)").

Finally, a use for <>. Barry will be so happy ;^)

-Casey




More information about the Python-Dev mailing list