When is min(a, b) != min(b, a)?

Antoon Pardon apardon at forel.vub.ac.be
Thu Jan 24 14:34:56 CET 2008

On 2008-01-21, Steven D'Aprano <steven at REMOVE.THIS.cybersource.com.au> wrote:
> On Sun, 20 Jan 2008 21:15:02 -0600, Albert Hopkins wrote:
> According to the IEEE-754 standard the usual trichotomy of "x is less 
> than y, x is equal to y, or x is greater than y" has to be extended to 
> include "x and y are unordered". Comparisons with NaNs are unordered, and 
> so expressions like "x < nan" should signal an exception.

That doesn't follow. The problem is not that x < nan returns False
because that is correct since x isn't smaller than nan. The problem 
is cmp(x, nan) returning 1, because that indicates that x is greater
than nan and that isn't true.

Antoon Pardon

More information about the Python-list mailing list