This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c/8825: optimization causes incorrect math
- From: bangerth at dealii dot org
- To: gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, joeytsai at yahoo dot com, nobody at gcc dot gnu dot org
- Date: 5 Dec 2002 19:19:58 -0000
- Subject: Re: c/8825: optimization causes incorrect math
- Reply-to: bangerth at dealii dot org, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, joeytsai at yahoo dot com, nobody at gcc dot gnu dot org, gcc-gnats at gcc dot gnu dot org
Synopsis: optimization causes incorrect math
State-Changed-From-To: open->closed
State-Changed-By: bangerth
State-Changed-When: Thu Dec 5 11:19:58 2002
State-Changed-Why:
You don't want to use
point.x = (int) move.x;
but want to round it to the next integer. With optimization,
move.x is about 6e-16 smaller than 112, without it is equal
to 112 (which is actually representable exactly as a
floating point number). Such differences at the level of
round-off are to be expected with optimization.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8825