Compare op1 and op2. Return a positive value if op1 > op2, zero if op1 = op2, and a negative value if op1 < op2. Both op1 and op2 are considered to their full own precision, which may differ. 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).
Compare op1 and op2 multiplied by two to the power e. Similar as above.
Compare |op1| and |op2|. Return a positive value if |op1| > |op2|, zero if |op1| = |op2|, and a negative value if |op1| < |op2|. If one of the operands is NaN, set the erange flag and return zero.
Return non-zero if op is respectively NaN, an infinity, an ordinary number (i.e. neither NaN nor an infinity) or zero. Return zero otherwise.
Return a positive value if op > 0, zero if op = 0, and a negative value if op < 0. If the operand is NaN, set the erange flag and return zero.
Return non-zero if op1 > op2, zero otherwise.
Return non-zero if op1 >= op2, zero otherwise.
Return non-zero if op1 <= op2, zero otherwise.
Return non-zero if op1 < op2 or op1 > op2 (i.e. neither op1, nor op2 is NaN, and op1 <> op2), zero otherwise (i.e. op1 and/or op2 are NaN, or op1 = op2).