darkblu said:although your concern is generally correct, the particular example you've given would always result in "OK" since both '0.1' constants get onto the fpu stack as doubes (the x87 does not have 80-bit interface to the world); now, *if* one of those '0.1' came as a result from a non-spilled (fpu-internal) calculation, where fpu prec had been set to 80bit, then undoubtedly the comparison would fail miserably.
x87 definitely can load/store a 80 bits FP (check Intel's manual for FLD and FSTP instructions). However, my example is not good enough since the compiler may store the pre-computed number (0.1) in 64 bits FP mode. A better example is
Code:
double a = 1.0 / 3.0;
if(a == 1.0 / 3.0) printf("OK"); else printf("not OK");
if the compiler does not precompute 1.0 / 3.0 (most compilers do, however), the result will be "not OK."