This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/20674] unexpected result from floating compare
- From: "piaget at us dot ibm dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 28 Mar 2005 22:09:03 -0000
- Subject: [Bug c++/20674] unexpected result from floating compare
- References: <20050328215100.20674.piaget@us.ibm.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From piaget at us dot ibm dot com 2005-03-28 22:09 -------
I do not think this is a precision problem. Although -ffloat-store resolves the
problem, I feel this has changed the behavior of the program sufficiently to
avoid the problem ... I should not have mentioned that -ffloat-store resolved
the problem in my earlier note
// following is pseudocode ... run actual testcase to see problem
float i=1.0; // actually, a bunch of math that = 1.0
if ( i <= 1.0 ) return 0;
if ( ( i > 1.0 ) && ( i < 1.0001 ) ) return 0;
return 1;
I should never get a 1 for a return code. Change 1.0001 in my testcase to 1.1,
you still see the problem.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |UNCONFIRMED
Resolution|DUPLICATE |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20674