Rational number (source code)

= Rational number
{title2=$\mathbb Q$}
{wiki}

= Rational
{synonym}

A <rational number> is a quotient $a/b$ of <integers> with $b\ne0$. The <numerator> $a$ can be negative or zero; the <denominator> $b$ can be chosen positive by transferring its sign to $a$. For example, $-6/8=-3/4$ and $0/7=0$.

Different <fractions> describe the same <rational number> exactly when <cross multiplication> gives $ad=bc$. Dividing the entries by their <greatest common divisor> produces the unique <reduced fraction> with positive <denominator>, including $0/1$ for zero.

The <rational numbers> form a <field>: <addition>, <subtraction>, <multiplication> and division by a nonzero <rational number> remain rational. They are <dense> in the <real line>, by <density of the rational numbers>, although they do not fill it: the <square root> of two is an <irrational number>.