Terminating Decimal

Fractions & Decimals

A terminating decimal is a decimal that ends after a finite number of digits, such as 0.25 or 3.125.

Definition

A terminating decimal is a decimal that stops after a certain number of digits rather than going on forever: examples include $0.5$, $0.25$, $3.75$, $0.125$. A fraction $a/b$ in lowest terms produces a terminating decimal if and only if $b$ has no prime factors other than $2$ and $5$, that is, $b = 2^m \cdot 5^n$ for some non-negative integers $m, n$, in which case the decimal terminates after $\max(m, n)$ digits, since $10 = 2 \times 5$ means $b$ always divides some power of $10$. More generally, a rational $p/q$ in lowest terms terminates in base $b$ iff every prime factor of $q$ also divides $b$; in base $2$ (binary), only fractions with denominators that are powers of $2$ terminate, which is why $0.1$ in base $10$ ($=1/10$) cannot be represented exactly in binary.

Example

$1/2 = 0.5$ (stops after $1$ digit), $1/4 = 0.25$ (stops after $2$ digits), and $1/8 = 0.125$ (stops after $3$ digits) are all terminating decimals. Checking $7/40$: since $40 = 2^3 \times 5$, it terminates after $\max(3,1) = 3$ digits, $7/40 = 175/1000 = 0.175$; but $1/6$ has $6 = 2 \times 3$, and the factor of $3$ means it repeats instead, $0.1666\ldots = 0.1\overline{6}$. The choice of base matters too: in base $12$ (duodecimal, where $12 = 2^2 \times 3$), $1/3 = 0.4$ terminates, while $1/5$ repeats, the opposite of what happens in base $10$.

Key Insight

Fractions that terminate always have denominators (in simplest form) whose only prime factors are $2$ and $5$, since our base-ten system is built from $2 \times 5$, only these factors "fit perfectly" into base ten; to predict whether a fraction terminates, you only need to check the denominator after simplifying, which tells you more than doing the actual long division. This termination condition reveals a deep connection between arithmetic and the structure of a number base: a "better" base for everyday arithmetic might be base $12$ (divisible by $2, 3, 4, 6$) because far more common fractions would terminate, a historical argument made by advocates of dozenal (base-$12$) arithmetic.