This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/12639] long double comparison is broken
- From: "christopher dot eltschka at physik dot uni-regensburg dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 27 Oct 2005 10:38:27 -0000
- Subject: [Bug target/12639] long double comparison is broken
- References: <bug-12639-0@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from christopher dot eltschka at physik dot uni-regensburg dot de 2005-10-27 10:38 -------
(In reply to comment #3)
> As workaround for == 0, !! seems to work. Unfortunately I don't know a
> workaround for > 0 and < 0.
>
Sorry for self-reply, but now I've found a simple workaround for all cases:
Instead of comparing with 0, just add 1 and compare with 1.
For some reason this works even if the number to compare with happens to be -1
(i.e. if after adding 1 you get 0).
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12639