[Bug c/45691] Floating point comparison failure

2010-09-16 Thread dominiq at lps dot ens dot fr
--- Comment #1 from dominiq at lps dot ens dot fr 2010-09-16 17:02 --- pr323? As a general rule: never compare floating points for equality, use abs(a-b)epsilon. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45691

[Bug c/45691] Floating point comparison failure

2010-09-16 Thread paolo dot carlini at oracle dot com
--- Comment #2 from paolo dot carlini at oracle dot com 2010-09-16 17:08 --- As an even more general rule, remember to always specify your target: in this case, for example, I can't reproduce at all the behavior on x86_64 -m64, only with -m32. --

[Bug c/45691] Floating point comparison failure

2010-09-16 Thread pinskia at gcc dot gnu dot org
--- Comment #3 from pinskia at gcc dot gnu dot org 2010-09-16 17:08 --- *** This bug has been marked as a duplicate of 323 *** *** This bug has been marked as a duplicate of 323 *** -- pinskia at gcc dot gnu dot org changed: What|Removed |Added

[Bug c/45691] Floating point comparison failure

2010-09-16 Thread jakub at gcc dot gnu dot org
--- Comment #4 from jakub at gcc dot gnu dot org 2010-09-16 17:13 --- i?86 is a FLT_EVAL_METHOD 2 target, so for strict C compliance all floating operations and constants are supposed to be evaluated in the precision of long double. The assignment of the constant to a double var or

[Bug c/45691] Floating point comparison failure

2010-09-16 Thread paolo dot carlini at oracle dot com
--- Comment #5 from paolo dot carlini at oracle dot com 2010-09-16 17:15 --- Thanks Jakub. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45691

[Bug c/45691] Floating point comparison failure

2010-09-16 Thread ian at macky dot net
--- Comment #6 from ian at macky dot net 2010-09-16 17:44 --- Subject: Re: Floating point comparison failure Thanks everyone. I usually do fuzzy floating-point comparison, except in certain special circumstances. I will switch to using double constants; I'm trying for a code that is