A rational is represented as a pair of integers, called numerator and denominator . Numerator and denominator are reduced , i.e., their greatest common divisor is 1. If the denominator is 1, the rational is in fact an integer and is represented as such. The numerator holds the sign of the rational, thus the denominator is always positive. Because the underlying integer arithmetic can compute with arbitrary size integers, the rational arithmetic is always exact, even for rationals whose numerators and denominators have thousands of digits.
Rationals is the field domain of all rationals.
Comparisons of Rationals 12.5. Operations for Rationals 12.6. Set Functions for Rationals 12.7.