DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH
 

(gmp.info.gz) Comparing Rationals

Info Catalog (gmp.info.gz) Rational Arithmetic (gmp.info.gz) Rational Number Functions (gmp.info.gz) Applying Integer Functions
 
 Comparison Functions
 ====================
 
  - Function: int mpq_cmp (mpq_t OP1, mpq_t OP2)
      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
      `mpq_cmp'.
 
  - Macro: int mpq_cmp_ui (mpq_t OP1, unsigned long int NUM2, unsigned
           long int DEN2)
  - Macro: int mpq_cmp_si (mpq_t OP1, long int NUM2, unsigned long int
           DEN2)
      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.
 
  - Macro: int mpq_sgn (mpq_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.
 
  - Function: int mpq_equal (mpq_t OP1, mpq_t OP2)
      Return non-zero if OP1 and OP2 are equal, zero if they are
      non-equal.  Although `mpq_cmp' can be used for the same purpose,
      this function is much faster.
 
Info Catalog (gmp.info.gz) Rational Arithmetic (gmp.info.gz) Rational Number Functions (gmp.info.gz) Applying Integer Functions
automatically generated byinfo2html