Go forward to Miscellaneous Rational Functions.
Go backward to Comparing Rationals.
Go up to Rational Number Functions.

Applying Integer Functions to Rationals
=======================================

   The set of `mpq' functions is quite small.  In particular, there are
no functions for either input or output.  But there are two macros that
allow us to apply any `mpz' function on the numerator or denominator of
a rational number.  If these macros are used to assign to the rational
number, `mpq_canonicalize' normally need to be called afterwards.

 - Macro: mpz_t mpq_numref (mpq_t OP)
 - Macro: mpz_t mpq_denref (mpq_t OP)
     Return a reference to the numerator and denominator of OP,
     respectively.  The `mpz' functions can be used on the result of
     these macros.