Re: What should MIN and MAX do when an argument is NaN ?



The proposed new IEEE standard (754r) specifies operations
MIN and MAX (each with two arguments - the high-level
language extension of them to multiple arguments is obvious).
If one argument is NaN, but not the other, the result is required
to be the non-NaN value. Only if both operands are NaN should
a NaN be ther result (and exceptions are raised only then).

This has been extensively discussed in this forum before. I no
longer find either side compelling, so I'm willing to comply with
the requirements of the standard (when and if it's approved).

--
J. Giles

"I conclude that there are two ways of constructing a software
design: One way is to make it so simple that there are obviously
no deficiencies and the other way is to make it so complicated
that there are no obvious deficiencies." -- C. A. R. Hoare


.



Relevant Pages

  • Re: How to store a number that is "n/a"?
    ... There are actually 2 flavours of NaN values defined by the ... IEEE standard: signalling and ... quiet (which simply propagate through calculations. ... store a number in the decimal array (or any other number array, ...
    (microsoft.public.vb.general.discussion)
  • Re: math.nroot [was Re: A brief question.]
    ... putting hundreds of tests for error conditions all through your code, ... you put one test at the very end: is the final result a NaN ... > That'd be like having a math package that allowed, ... the IEEE standard requires both of those to return ...
    (comp.lang.python)
  • Re: Fortran / IEEE 754: MAXVAL and INF, NaN
    ... MAXVAL([NaN]) ... INF, and NaN. ... Unfortunately proposed new the IEEE standard ... Only if all the operands are NaN do the MIN and MAX ...
    (comp.lang.fortran)
  • Re: How can I handle Nan quantities?
    ... that's actually backwards according to the ... IEEE standard: comparisons using NaN should always return false. ...
    (comp.lang.fortran)