This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Float point issue
- From: Robert Dewar <dewar at adacore dot com>
- To: Zoltán Kócsi <zoltan at bendor dot com dot au>
- Cc: gcc at gcc dot gnu dot org
- Date: Thu, 27 Oct 2011 23:31:14 -0400
- Subject: Re: Float point issue
- References: <20111028131705.62a2efa6@tade.bendor.com.au>
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