In mathematics, a rational number is any number that can be expressed as the quotient or fraction p/q of two integers, a numerator p and a non-zero denominator q. Since q may be equal to 1, every integer is a rational number. The set of all rational numbers, often referred to as “the rationals“, is usually denoted by a boldface Q for “quotient”.
The decimal expansion of a rational number always either terminates after a finite number of digits or begins to repeat the same finite sequence of digits over and over. Moreover, any repeating or terminating decimal represents a rational number.
A real number that is not rational is called irrational. Irrational numbers include √2, π, e, and φ. The decimal expansion of an irrational number continues without repeating.
Zero divided by any other integer equals zero; therefore, zero is a rational number (but division by zero is undefined).
Embedding of integers
Any integer n can be expressed as the rational number n/1.
- if and only if a d = b c .
Where both denominators are positive:
- if and only if
If either denominator is negative, the fractions must first be converted into equivalent forms with positive denominators, through the equations:
Two fractions are added as follows:
The rule for multiplication is:
Where c ≠ 0:
Note that division is equivalent to multiplying by the reciprocal of the divisor fraction:
Additive and multiplicative inverses exist in the rational numbers:
Exponentiation to integer power
If n is a non-negative integer, then
and (if a ≠ 0):
Continued fraction representation
A finite continued fraction is an expression such as
where an are integers. Every rational number a/b has two closely related expressions as a finite continued fraction, whose coefficients an can be determined by applying the Euclidean algorithm to (a,b).