Rational number

In mathematics, a rational number is a number which can be expressed as a ratio of two integers. Non-integer rational numbers (commonly called fractions) are usually written as the vulgar fraction a / b, where b is not zero.

Each rational number can be written in infinitely many forms, such as 3 / 6 = 2 / 4 = 1 / 2, but it is said to be in simplest form when a and b have no common divisors except 1 (i.e., they are coprime). Every non-zero rational number has exactly one simplest form of this type with a positive denominator. A fraction in this simplest form is said to be an irreducible fraction, or a fraction in reduced form.

The decimal expansion of a rational number is eventually periodic (in the case of a finite expansion the zeroes which implicitly follow it form the periodic part). The same is true for any other integral base above one, and is also true when rational numbers are considered to be p-adic numbers rather than real numbers. Conversely, if the expansion of a number for one base is periodic, it is periodic for all bases and the number is rational. A real number that is not a rational number is called an irrational number.

The set of all rational numbers, which constitutes a field, is denoted \mathbb{Q}. Using the set-builder notation, \mathbb{Q} is defined as