Formula and Method for Terminating Decimals
A fraction a/b, once reduced to lowest terms, has a decimal expansion that terminates (ends after a finite number of digits) if and only if the reduced denominator b has no prime factors other than 2 and 5. Write the reduced denominator as b = 2^p × 5^q; the decimal terminates after exactly max(p, q) digits. If, after dividing out every factor of 2 and 5, anything other than 1 remains in the denominator, the decimal instead repeats forever, and long division reveals the repeating block.
How the calculation works
Enter a numerator and denominator. The calculator first reduces the fraction by dividing both by their greatest common divisor (GCD). It then strips all factors of 2 (counting p) and all factors of 5 (counting q) out of the reduced denominator. If nothing but 1 is left, the fraction terminates after max(p, q) decimal places — for example, 3/8 has denominator 2³, so it terminates after 3 places: 3/8 = 0.375. If a factor other than 2 or 5 remains, the calculator performs long division and tracks every remainder it sees; when a remainder repeats, the digits between the two occurrences form the repeating block, shown in parentheses (for example, 1/6 = 0.1(6), meaning 0.1666...).
Common mistakes
- Not reducing the fraction first: the termination rule applies to the denominator in lowest terms. 6/15 looks like it has a factor of 3 in the denominator, but it reduces to 2/5, which terminates (0.4).
- Forgetting the sign: a negative numerator or denominator only flips the sign of the result — it has no effect on whether the decimal terminates or repeats.
- Assuming any small denominator terminates: denominators like 3, 6, 7, 9, 11, and 12 all contain a prime factor other than 2 or 5, so fractions like 1/3, 1/6, 1/7, 1/9, 1/11, and 1/12 all repeat, even though the numbers look simple.
Real-world applications
- Currency and measurement conversions rely on terminating decimals (like 1/4 = 0.25) to avoid rounding error when splitting bills or measuring materials.
- Teaching fraction-to-decimal conversion uses the 2-and-5 rule to predict, before dividing, whether a fraction will terminate or repeat.
- Programming and floating-point analysis use the same rule to explain why fractions like 1/10 are exact in base 10 but not exact in binary floating point.
- Number theory and cryptography use the related idea of the "period" of a repeating decimal, which equals the multiplicative order of 10 modulo the denominator's non-2, non-5 part.