Go forward to Integer Logic and Bit Fiddling.
Go backward to Integer Arithmetic.
Go up to Integer Functions.

Comparison Functions
====================

 - Function: int mpz_cmp (mpz_t OP1, mpz_t OP2)
     Compare OP1 and OP2.  Return a positive value if OP1 > OP2, zero
     if OP1 = OP2, and a negative value if OP1 < OP2.

 - Macro: int mpz_cmp_ui (mpz_t OP1, unsigned long int OP2)
 - Macro: int mpz_cmp_si (mpz_t OP1, signed long int OP2)
     Compare OP1 and OP2.  Return a positive value if OP1 > OP2, zero
     if OP1 = OP2, and a negative value if OP1 < OP2.

     These functions are actually implemented as macros.  They evaluate
     their arguments multiple times.

 - Macro: int mpz_sgn (mpz_t OP)
     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
     arguments multiple times.