c/7437: Identical unsigned int calculations differ by 1, depending on number of steps in calculation.
Geoff Keating
geoffk@geoffk.org
Mon Jul 29 15:36:00 GMT 2002
The following reply was made to PR c/7437; it has been noted by GNATS.
From: Geoff Keating <geoffk@geoffk.org>
To: sewell@dramail.com
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: c/7437: Identical unsigned int calculations differ by 1, depending on number of steps in calculation.
Date: 29 Jul 2002 15:33:55 -0700
This is covered in the manual:
* On 68000 and x86 systems, for instance, you can get paradoxical
results if you test the precise values of floating point numbers.
For example, you can find that a floating point value which is not
a NaN is not equal to itself. This results from the fact that the
floating point registers hold a few more bits of precision than
fit in a `double' in memory. Compiled code moves values between
memory and floating point registers at its convenience, and moving
them into memory truncates them.
You can partially avoid this problem by using the `-ffloat-store'
option (*note Optimize Options::).
--
- Geoffrey Keating <geoffk@geoffk.org> <geoffk@redhat.com>
More information about the Gcc-prs
mailing list