Next: Applying Integer Functions, Previous: Rational Arithmetic, Up: Rational Number Functions [Index]
Compare op1 and op2. Return a positive value if op1 > op2, zero if op1 = op2, and a negative value if op1 < op2.
To determine if two rationals are equal,
mpq_equal is faster than
Compare op1 and num2/den2. Return a positive value if op1 > num2/den2, zero if op1 = num2/den2, and a negative value if op1 < num2/den2.
num2 and den2 are allowed to have common factors.
These functions are implemented as a macros and evaluate their arguments multiple times.
Return +1 if op > 0, 0 if op = 0, and -1 if op < 0.
This function is actually implemented as a macro. It evaluates its argument multiple times.
Return non-zero if op1 and op2 are equal, zero if they are
mpq_cmp can be used for the same purpose, this
function is much faster.