August 21, 2012Re: NaNs Just Don't Get No Respect
Posted in reply to Don Clugston
On Tuesday, 21 August 2012 at 08:15:10 UTC, Don Clugston wrote: > No, it's the other way around. > The IEEE 754 standard defines min(x, NaN) == min(NaN, x) == x. > > According to the C standard, fmin() should be returning 10, as well. > There is a bug in fmin(). > > However min() and max() are extremely unusual in this respect. Almost everything else involving a NaN returns NaN. I did not know that. It seems like a not-so-useful rule but I guess they have their reasons. Note that in my example, fmin() _did_ return 10 - it was min() that returned NaN...
Copyright © 1999-2016 by the D Language Foundation