These functions assign between either the numerator or denominator of a
rational, and an integer. Instead of using these functions, it is preferable
to use the more general mechanisms mpq_numref and mpq_denref,
together with mpz_set.
mpq_canonicalize before any operations
are performed on rational.
This function is equivalent to
mpz_set (mpq_numref (rational), numerator).
mpq_canonicalize before any operations are performed on rational.
In version 1 of the library, negative denominators were handled by copying the sign to the numerator. That is no longer done.
This function is equivalent to
mpz_set (mpq_denref (rational), denominators).
This function is equivalent to
mpz_set (numerator, mpq_numref (rational)).
This function is equivalent to
mpz_set (denominator, mpq_denref (rational)).
Go to the first, previous, next, last section, table of contents.