Grant Edwards <[EMAIL PROTECTED]> writes:

 > For applications I work on, it should be NaN.  But I think the
 > result of comparing a Normal to a NaN is undefined, so the
 > above behavior is allowed by the IEEE spec.

Comparison of two floating point datums results in exactly one of
these being true:

1) less than
2) equal
3) greater than
4) unordered


IEEE 754r defines maxNum and minNum which are explicitly defined to
return one argument if the other is a NaN.  Any other operation (apart
from a few others that are specified) return a NaN if any argument is
NaN.

NaN generally represents the result of an invalid operation.  Using it
for missing value is not in the draft standard, though it is not
forbidden either.

If NaNs in your data are important then you must take care in explicit
and implicit comparisons to consider unordered results.
-- 
Pete Forman                -./\.-  Disclaimer: This post is originated
WesternGeco                  -./\.-   by myself and does not represent
[EMAIL PROTECTED]    -./\.-   the opinion of Schlumberger or
http://petef.port5.com           -./\.-   WesternGeco.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to