The real numbers that are rational are those whose decimal expansion either terminates after a finite number of digits (example: 3/4 = 0.75), or eventually begins to repeat the same finite sequence of digits over and over (example: 9/44 = 0.20454545...).
[5] Irrational numbers include the square root of 2 (
[1] Rational numbers can be formally defined as equivalence classes of pairs of integers (p, q) with q ≠ 0, using the equivalence relation defined as follows: The fraction
On the contrary, it is ratio that is derived from rational: the first use of ratio with its modern meaning was attested in English about 1660,[8] while the use of rational for qualifying numbers appeared almost a century earlier, in 1570.
[10][11] This unusual history originated in the fact that ancient Greeks "avoided heresy by forbidding themselves from thinking of those [irrational] lengths as numbers".
[12] So such lengths were irrational, in the sense of illogical, that is "not to be spoken about" (ἄλογος in Greek).
[13] Every rational number may be expressed in a unique way as an irreducible fraction
This is often called the canonical form of the rational number.
its canonical form may be obtained by dividing a and b by their greatest common divisor, and, if b < 0, changing the sign of the resulting numerator and denominator.
[14] The rule for multiplication is: where the result may be a reducible fraction—even if both original fractions are in canonical form.
[14] If n is a non-negative integer, then The result is in canonical form if the same is true for
A finite continued fraction is an expression such as where an are integers.
can be represented as a finite continued fraction, whose coefficients an can be determined by applying the Euclidean algorithm to (a, b).
The rational numbers may be built as equivalence classes of ordered pairs of integers.
An equivalence relation is defined on this set by Addition and multiplication can be defined by the following rules: This equivalence relation is a congruence relation, which means that it is compatible with the addition and multiplication defined above; the set of rational numbers
is the defined as the quotient set by this equivalence relation,
equipped with the addition and the multiplication induced by the above operations.
(This construction can be carried out with any integral domain and produces its field of fractions.
The canonical representative is the unique pair (m, n) in the equivalence class such that m and n are coprime, and n > 0.
It is called the representation in lowest terms of the rational number.
of all rational numbers, together with the addition and multiplication operations shown above, forms a field.
Every field of characteristic zero contains a unique subfield isomorphic to
are positive), we have Any totally ordered set which is countable, dense (in the above sense), and has no least or greatest element is order isomorphic to the rational numbers.
[17] The set of all rational numbers is countable, as is illustrated in the figure to the right.
As a rational number can be expressed as a ratio of two integers, it is possible to assign two integers to any point on a square lattice as in a Cartesian coordinate system, such that any grid point corresponds to a rational number.
This method, however, exhibits a form of redundancy, as several different grid points will correspond to the same rational number; these are highlighted in red on the provided graphic.
The rational numbers are an important example of a space which is not locally compact.
The rationals are characterized topologically as the unique countable metrizable space without isolated points.
into a topological field: Let p be a prime number and for any non-zero integer a, let
Ostrowski's theorem states that any non-trivial absolute value on the rational numbers