On Tue, 20 Jul 2004 12:08:07 +0200, Alexander Stippler
<st**@mathematik.uni-ulm.de> wrote:
Hi,
what about "not a number"? What does the standard enforce, what not?
I read in the C standard, that NAN is defined if and only if the
implementation supports quiet NaNs for the float type.
But what about the behaviour of NaNs, e.g. comparison with 'normal' values,
operator application (+, -, *, /). Where is it defined, if at all?
The standard is quiet about it. However, if you have IEEE 754 floating
point, then I think all comparisons against NAN return false, but you
should read the IEEE 754 standard (or descriptions thereof) to check
this.
Note std::numeric_limits<double>::is_iec559 tells you whether the
floating point is IEEE 754 (aka IEC 559) compatible.
Tom