This file defines a few very basic functions which I feel should
really be part of the GMP library. Nevertheless I have placed all
definitions inside the namespace
CoCoA. Here is a summary:
mpq_cmpabs(q1,q2)compare absolute values of rationals
mpz_rounddiv(Q,N,D)-- compute Q = N/D where the quotient is rounded to an integer (currently halves round away from zero).
mpq_round(N, Q)-- round rational
Qto an integer; halves round the same way as in
The implementations are not exception safe. The emphasis was on obvious correctness rather than greatest speed.
mpq_round return a boolean saying
whether the quotient was in fact an integer.