On Thu, Dec 28, 2006 at 08:05:53PM -0500, Joe Smith wrote:
No. What they are warning is that
x=y;
assert(x==y);
may fail, even for !isnan(y)
Lets say y is a 10-byte extended precision double in the FPU.
For some reason, the compiler decides that 'x' should be storred in
memory.
So x is set to a 8-byte representation of y, created by truncation. The
extra 2 bytes of precision means that
x and y do not compare equally.
We all know the issues with the x86 high-resolution FPU registers;
we don't need an introduction. :) That's not what it says, though:
For example, you can find that a floating point value which is not a
NaN is not equal to itself.
This is saying that assert(x==x) may fail for non-NaN, and seems to be
specifically saying that the "x!=x" test for NaN-ness may not always
work. As far as I know, this is simply incorrect, and this documentation
is wrong.