[Bug c++/70175] Condition comparing two float numbers

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Mar 10 22:15:00 GMT 2016


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70175

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |jakub at gcc dot gnu.org
         Resolution|---                         |INVALID

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
That is excess precision, use -msse2 -mfpmath=sse or -ffloat-store to avoid
this.  Or even better yet, avoid equality comparisons of floating point
numbers, instead check if the absolute value of the difference of two numbers
is small enough.


More information about the Gcc-bugs mailing list