This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/34333] if(nan == nan) wrongly returns TRUE, when nan is a parameter
- From: "burnus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 Dec 2007 10:26:19 -0000
- Subject: [Bug fortran/34333] if(nan == nan) wrongly returns TRUE, when nan is a parameter
- References: <bug-34333-13404@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from burnus at gcc dot gnu dot org 2007-12-04 10:26 -------
http://www.mpfr.org/mpfr-2.3.0/mpfr.html#Comparison-Functions
? Function: int mpfr_cmp (mpfr_t op1, mpfr_t op2)
"If one of the operands is NaN, set the erange flag and return zero.
Note: These functions may be useful to distinguish the three possible cases. If
you need to distinguish two cases only, it is recommended to use the predicate
functions (e.g., mpfr_equal_p for the equality) described below; they behave
like the IEEE-754 comparisons, in particular when one or both arguments are
NaN. But only floating-point numbers can be compared (you may need to do a
conversion first)."
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34333