x87 float truncation/accuracy (gcc vs. icc/msvc)
Robert Dewar
dewar@gnat.com
Sun Mar 21 02:04:00 GMT 2004
> Could you please explain what's wrong with incorrectly rounded results?
What's wrong with them is that they are incorrectly rounded!
> I was under the impression accuracy and performance is more important to
> most people.
Incorrect rounding is precisely a case of giving inaccurate results. Now
there are those who are willing to tolerate inaccurate results if they
can get them faster. After all lots of Fortran programmers tolerate
Cray's fast junk arithmetic (in which 81.0/3.0 was not 27.0) for
years! But this kind of behavior should not occur by default in
a compiler that advertises itself as a C compiler!
> And please don't expect everyone to use a flag
> named unsafe-math-optimizations.
Why not? That's exactly what you are talking about, optimizations
that are not safe, in the sense that they give wrong results.
More information about the Gcc
mailing list