On 10/27/2011 10:17 PM, Zoltán Kócsi wrote:
I wonder whether
- I know the IEEE rounding rules incorrectly
yes, you do, but you are ignoring the extended precision
phenomenon which can lead to double rounding
- I am missing a gcc flag
probably you should avoid extra precision and all the
issues it brings, as well as speed up your program, by
using SSE 64-bit arithmetic (using the appropriate gcc
flags)
- gcc is doing something funny when setting up the FPU
no nothing funny
- Intel's FPU is not standard compiant
it's compliant, but it does by default use extended
precision for intermediate results, which is an allowed
mapping for C, but leads to unexpected results as you see
Thanks,
Zoltan