This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
meaning of floating-point comparison operators
- From: Miles Bader <miles at lsi dot nec dot co dot jp>
- To: gcc at gcc dot gnu dot org
- Date: Thu, 27 Jan 2005 18:01:04 +0900
- Subject: meaning of floating-point comparison operators
- Reply-to: Miles Bader <miles at gnu dot org>
GCC defines the following comparison operators:
/* Comparison operations. The ordered comparisons exist in two
flavors, signed and unsigned. */
NE, EQ, GE, GT, LE, LT, GEU, GTU, LEU, LTU
/* Additional floating point unordered comparision flavors. */
UNORDERED, ORDERED
/* These are equivalent to unordered or ... */
UNEQ, UNGE, UNGT, UNLE, UNLT
/* This is an ordered NE, ie !UNEQ, ie false for NaN. */
LTGT
The UN* operators, ORDERED, and UNORDERED, have obvious meaning, but
are the other ("normal") operators supposed to be equivalent to
"ORDERED && ...", or are they supposed to signal an exception if the
operands aren't ordered?
The reason I ask is because the machine I'm porting to offers
"ORDERED && ..." tests, "UNORDERED || ..." tests, and "signal if not
ordered" tests.
If the meaning is indeed "ORDERED && ...", NE would be synonymous
with LTGT, which makes me suspect that's not the case, but the way
that `reverse_condition_maybe_unordered' works (it reverses the
operators as if that _were_ the meaning) makes me wonder.
Thanks,
-Miles
--
"I distrust a research person who is always obviously busy on a task."
--Robert Frosch, VP, GM Research