See How Things Work

Terminating decimals

Unit
Decimals
Part
3. Converting Fractions & Decimals
Lesson
3.2

A terminating decimal is a decimal whose digits end. This lesson proves exactly which fractions are terminating decimals: those whose denominator in lowest terms has no prime factor other than 2 and 5. It also proves how many decimal places such a fraction needs: the larger of the number of 2s and the number of 5s in that denominator.

Terminating decimals

The decimals of this unit have finitely many digits after the point (Decimal place value). The lesson Fractions to decimals found that the long division of a fraction sometimes ends and sometimes does not, so a name is needed for decimals whose digits end.

Definition (Terminating decimal).

A terminating decimal, or finite decimal, is a decimal with finitely many digits after the point.⁠[1] A fraction terminates, or has a terminating decimal, when it is equal to a terminating decimal.

By Theorem 1 of the lesson Decimals as fractions, a terminating decimal with k places is a fraction with denominator 1 followed by k zeros; a finite decimal is just such a fraction.⁠[2] When the long division of a fraction ends, it can be continued, but every later step divides 0 and writes 0: in this sense the decimal of the fraction terminates in 0s.⁠[3]

Theorem 1.

Let a be a whole number and b a counting number. The long division of a by b ends with remainder 0 exactly when ab is a terminating decimal.

Proof.

If the division ends, Theorem 1 of the lesson Fractions to decimals shows that the quotient is a terminating decimal equal to ab. Conversely, if ab equals a decimal with j places, that decimal is ND, with D the 1 followed by j zeros, and the Proposition “the two methods agree” of the same lesson shows that the division ends, at the latest after j places.

So the question “does the division of a by b end?” and the question “is ab a terminating decimal?” are the same question. The rest of the lesson answers it without dividing.

Which fractions terminate

The lesson Decimals as fractions proved one half of the answer: in lowest terms, the denominator of a terminating decimal has no prime factor other than 2 and 5. The following theorem adds the other half, and so characterizes all the fractions that are equal to finite decimals.⁠[4]

Theorem 2 (which fractions terminate).

Let ab be a fraction in lowest terms. It is a terminating decimal exactly when b has no prime factor other than 2 and 5, that is, when b is 1 or a product of 2s and 5s.

Proof.

Only these denominators. If ab is a terminating decimal, the Proposition of the lesson Decimals as fractions shows that no prime other than 2 and 5 divides b.

All of them. Let b be the product of s factors 2 and t factors 5 (s or t may be 0), and let m be the larger of s and t. Multiply b by m − s more factors 2 and m − t more factors 5, and call the product of these added factors k. Then b × k has m factors 2 and m factors 5. By the associative and commutative properties (The associative property of multiplication) they can be grouped in m pairs 2 × 5 = 10, so b × k is m factors 10: the 1 followed by m zeros, D. By the Equivalent Fractions Property (Equivalent fractions), ab = a × kD, which is a decimal with m places (Theorem 2 of Decimals as fractions).

In other words, a fraction has a terminating decimal exactly when its denominator in lowest terms is made of 2s and 5s,⁠[5] and every fraction in lowest terms with such a denominator terminates.⁠[6] The figure shows the second half of the proof for b = 80.

2s5s2510251025102510
Figure. 80 = 2 × 2 × 2 × 2 × 5 has four 2s (blue) and one 5 (green). Three more 5s (dashed amber), whose product is 125, complete four pairs 2 × 5, so 80 × 125 = 10 × 10 × 10 × 10 = 10,000. Hence a80 = a × 12510,000, a decimal with four places.
Example (Deciding without dividing).

Which of 780, 1124 and 9625 are terminating decimals?

  1. 780: 7 is prime and does not divide 80, so the fraction is in lowest terms. 80 = 2 × 2 × 2 × 2 × 5: it terminates. As in the figure, 780 = 87510,000 = 0.0875.
  2. 1124: 11 is prime and does not divide 24, so it is in lowest terms. 24 = 2 × 2 × 2 × 3 has the prime factor 3: it does not terminate.
  3. 9625: 625 = 5 × 5 × 5 × 5, and 9 = 3 × 3 has no factor 5, so the fraction is in lowest terms. It terminates: 625 × 16 = 10,000, so 9625 = 14410,000 = 0.0144.

Answer: 780 and 9625 terminate; 1124 does not. Check the second by dividing: 11 = 0 × 24 + 11; 110 = 4 × 24 + 14; 140 = 5 × 24 + 20; 200 = 8 × 24 + 8; 80 = 3 × 24 + 8; 80 = 3 × 24 + 8, and the remainder 8 now returns at every step.

Caution.

The theorem is about the denominator in lowest terms. A fraction that is not in lowest terms may have a 3 or a 7 in its denominator and still terminate, because that factor cancels.⁠[7] The numerator matters only through such cancelling.

Example (Lowest terms first).

Do 2130 and 39120 terminate?

  1. 30 = 2 × 3 × 5 has the factor 3, but so does 21 = 3 × 7: 2130 = 710 (Simplifying to lowest terms) = 0.7.
  2. 120 = 2 × 2 × 2 × 3 × 5 and 39 = 3 × 13; the greatest common divisor is 3, and 39120 = 1340. 40 = 2 × 2 × 2 × 5, so it terminates: 40 × 25 = 1,000 and 1340 = 3251,000 = 0.325.

Answer: both terminate, although both denominators have the prime factor 3. Check: 0.325 × 120 = 39.000.

Example (Edge cases: whole numbers and the numerator 0).

What does Theorem 2 say about 124, 07 and 51?

  1. 124 = 31 in lowest terms. The denominator 1 has no prime factor at all, so the condition holds: s = t = 0, m = 0, and the decimal has 0 places. Indeed 124 = 3.
  2. 07: the greatest common divisor of 0 and 7 is 7, so in lowest terms it is 01 = 0. It terminates, although 7 is a prime other than 2 and 5: the lowest terms are what count.
  3. 51 = 5, a whole number. Every whole number is a terminating decimal with no digits after the point (or with zeros after it: 5 = 5.0).

Answer: all three terminate; they are the whole numbers 3, 0 and 5.

Example (A mistake: “6/75 does not terminate, because 75 = 3 × 25”).

Check the claim.

  1. The claim looks at 75 before the fraction is in lowest terms.
  2. 6 = 2 × 3 and 75 = 3 × 5 × 5 have the common factor 3: 675 = 225.
  3. 25 = 5 × 5 is made of 5s: 25 × 4 = 100, so 225 = 8100 = 0.08.

Answer: the claim is false; 675 = 0.08. Check: 0.08 × 75 = 6.00.

How many decimal places

The proof of Theorem 2 used m places, the larger of the number of 2s and the number of 5s. No terminating decimal with fewer places can equal the fraction. The number of places of the shortest decimal is given by these two counts.⁠[8]

Theorem 3 (the number of places).

Let ab be in lowest terms, with b the product of s factors 2 and t factors 5, and let m be the larger of s and t. Then ab is a decimal with m places, and it is equal to no decimal with fewer places. Its long division ends after exactly m places.

Proof.

The proof of Theorem 2 wrote ab as a decimal with m places. Suppose it were also a decimal with k places, k less than m. By the Proposition of the lesson Decimals as fractions, b would divide the 1 followed by k zeros, which is the product of k factors 2 and k factors 5. (If k = 0, b would divide 1, so b = 1 and m = 0, which is not more than k.) By the Theorem of the section “Every divisor from the factorization” of the lesson Prime factorization is unique, the prime factorization of a divisor contains each prime at most as many times as the number it divides. So s ≤ k and t ≤ k, and m ≤ k: a contradiction.

By the Proposition “the two methods agree” of Fractions to decimals, the long division ends after at most m places. If it ended earlier, after k places with k less than m, then ab would be a decimal with k places (Theorem 1), which was just shown to be impossible.

The m-place decimal does not end in 0: if it did, dropping that zero (Decimal place value) would give an equal decimal with fewer places. A decimal with more than m places equals the fraction only when its extra last digits are zeros.

Example (Counting the places).

How many places do 1140, 7128 and 9625 need? Write the decimals.

  1. 40 = 2 × 2 × 2 × 5: s = 3, t = 1, so m = 3. Two more 5s: 40 × 25 = 1,000, and 1140 = 2751,000 = 0.275.
  2. 128 is the product of seven 2s: s = 7, t = 0, m = 7. Seven 5s multiply to 78,125, and 128 × 78,125 = 10,000,000. So 7128 = 546,87510,000,000 = 0.0546875.
  3. 625 is four 5s: m = 4, and as above 9625 = 0.0144.

Answer: 3, 7 and 4 places: 0.275, 0.0546875 and 0.0144. Each has exactly m places and its last digit is not 0, as Theorem 3 says.

Example (A mistake: “1/80 has one decimal place, since 80 has one zero”).

Find the number of places of 180.

  1. The zeros at the end of the denominator do not count the places; its 2s and 5s do.
  2. 80 = 2 × 2 × 2 × 2 × 5: s = 4, t = 1, m = 4.
  3. 80 × 125 = 10,000: 180 = 12510,000 = 0.0125.

Answer: four places, 0.0125. Check: 0.0125 × 80 = 1.0000.

Game

Does it terminate?

Round
1
Score
0
Streak
0

Without dividing: does the decimal of 2320 terminate, and if so, after how many places?

Historical note.

The Babylonians wrote numbers in base sixty. Their tables of reciprocals have gaps: numbers such as 7, 11, 13 and 14 are missing, because only fractions with a finite expansion in base sixty were understood, and the reciprocals of these “irregular” numbers do not terminate.⁠[9] Since 60 = 2 × 2 × 3 × 5, the argument of Theorem 2 shows that in base sixty the terminating fractions are those whose denominator in lowest terms has no prime factor other than 2, 3 and 5. Bases other than ten are the subject of the lesson Positional notation in any base of the unit Number Bases.

Looking ahead.

A fraction that does not terminate still has a decimal with infinitely many digits, which repeat. That is the lesson Repeating decimals; the lesson Which fractions terminate and why puts the two cases together.

Exercises

Exercise .

Which terminate? 1750, 524, 26208, 445.

▸ Show solution
  • 1750: in lowest terms, 50 = 2 × 5 × 5: terminates, 0.34.
  • 524: in lowest terms, 24 = 2 × 2 × 2 × 3: does not terminate.
  • 26208: 208 = 8 × 26, so 26208 = 18: terminates, 0.125.
  • 445: 45 = 3 × 3 × 5 and 4 = 2 × 2 have no common factor; the 3 remains: does not terminate.
Exercise .

Without dividing, find the number of places, then the decimal: 1160, 33,125, 7400.

▸ Show solution
  • 160 = five 2s and one 5: 5 places. 160 × 625 = 100,000, so 1160 = 625100,000 = 0.00625.
  • 3,125 = five 5s: 5 places. 3,125 × 32 = 100,000, so 33,125 = 96100,000 = 0.00096.
  • 400 = four 2s and two 5s: 4 places. 400 × 25 = 10,000, so 7400 = 17510,000 = 0.0175.
Exercise .

For which counting numbers c from 1 to 20 is 1c a terminating decimal? Give the number of places in each case.

▸ Show solution

By Theorem 2, 1/c terminates exactly when c is made of 2s and 5s: c = 1, 2, 4, 5, 8, 10, 16, 20. By Theorem 3 the places are 0, 1, 2, 1, 3, 1, 4, 2: 1, 0.5, 0.25, 0.2, 0.125, 0.1, 0.0625, 0.05.

Exercise .

Neither 13 nor 16 terminates. Show that their sum does, and explain why this does not contradict Theorem 2.

▸ Show solution

13 + 16 = 26 + 16 = 36 = 12 = 0.5 (Adding fractions with different denominators). Theorem 2 is about one fraction in lowest terms; a sum of two fractions can have a denominator in lowest terms from which the 3 has cancelled.

Exercise .

Let a be odd and b the product of s factors 2, with s at least 1. Prove that ab has exactly s decimal places and that its last digit is 5.

▸ Show solution

a is odd, so 2 does not divide a, and the only prime of b is 2: ab is in lowest terms. b is the product of s factors 2 and no 5, so by Theorem 3 the decimal has exactly s places. Multiplying by s factors 5, whose product we call k, gives ab = a × kD, D the 1 followed by s zeros.

The last digit of the decimal is the ones digit of a × k. Since s ≥ 1, a × k is a multiple of 5, so its ones digit is 0 or 5; it is odd, because a is odd and k is a product of 5s, both odd, so its ones digit is 5. For example, 316 = 1,87510,000 = 0.1875.

Exercise .

How many fractions a1,260 with a from 1 to 1,259 are terminating decimals?

▸ Show solution

Write b = 2 × 2 × 3 × 3 × 5 × 7 = 1,260 (Prime factorization). In lowest terms the denominator is b divided by the greatest common divisor of a and b. For the decimal to terminate, the factors 3, 3 and 7 must all cancel, so 3 × 3 × 7 = 63 must divide a. The fractions 63 × j1,260 = j20 with j from 1 to 19 are the proper ones. So exactly 19 proper fractions with this denominator terminate (and each has at most 2 places, since 20 = 2 × 2 × 5).

Summary

  1. A terminating (finite) decimal has finitely many digits after the point. The long division of a by b ends exactly when a/b is a terminating decimal.
  2. A fraction in lowest terms terminates exactly when its denominator has no prime factor other than 2 and 5: completing the 2s and 5s to pairs makes 1 followed by zeros.
  3. Write the fraction in lowest terms first: 21/30 = 7/10 terminates although 30 has the factor 3.
  4. If the denominator in lowest terms has s factors 2 and t factors 5, the decimal has exactly max(s, t) places, the larger count, and its last digit is not 0.
  5. The long division of such a fraction ends after exactly that many places.

Sources

  1. 1.
    Eric W. Weisstein, “Regular Number”, MathWorld, a Wolfram Web Resource.
    “A regular number, also called a finite decimal, is a positive real number that has a terminating decimal expansion.”
    Used for: a decimal with finitely many digits after the point is called a terminating decimal, or a finite decimal.
  2. 2.
    H. Wu, Pre-Algebra (draft of April 21, 2010; revised October 26, 2011, Department of Mathematics, University of California, Berkeley, 2011).
    Chapter 3, “The Euclidean Algorithm”, section 2, “The fundamental theorem of arithmetic”, p. 186 (the whole topic: pp. 183–188). Read it online.
    “It is also good to recall that a finite decimal is just a fraction whose denominator is a power of 10.”
    Used for: a terminating decimal is a fraction whose denominator is 1 followed by zeros.
  3. 3.
    “The Number System, Grade 7”, Common Core State Standards Initiative (National Governors Association and Council of Chief State School Officers).
    Section “Apply and extend previous understandings of operations with fractions (CCSS.Math.Content.7.NS.A.2.d)”. thecorestandards.org/Math/Content/7/NS · open at the quoted passage.
    “know that the decimal form of a rational number terminates in 0s or eventually repeats”
    Used for: the decimal of a fraction whose division ends terminates in 0s: every later step writes 0.
  4. 4.
    H. Wu, Pre-Algebra (draft of April 21, 2010; revised October 26, 2011, Department of Mathematics, University of California, Berkeley, 2011).
    Chapter 3, “The Euclidean Algorithm”, section 2, “The fundamental theorem of arithmetic”, p. 185 (the whole topic: pp. 183–188). Read it online.
    “The following characterizes all the fractions which are equal to finite decimals.”
    Used for: Theorem 2 characterizes all the fractions equal to finite decimals (Wu’s Theorem 2: a denominator made of 2s and 5s gives a finite decimal, and conversely for a reduced fraction).
  5. 5.
    Eric W. Weisstein, “Decimal Expansion”, MathWorld, a Wolfram Web Resource.
    “A rational number has a terminating decimal expansion iff its reduced denominator has the form”
    Used for: a fraction has a terminating decimal exactly when its denominator in lowest terms is made of 2s and 5s (the form follows on the page, as a product of powers of 2 and 5).
  6. 6.
    Eric W. Weisstein, “Regular Number”, MathWorld, a Wolfram Web Resource.
    “Conversely, every reduced fraction of this form has a terminating decimal expansion.”
    Used for: every fraction in lowest terms whose denominator is made of 2s and 5s terminates.
  7. 7.
    H. Wu, Pre-Algebra (draft of April 21, 2010; revised October 26, 2011, Department of Mathematics, University of California, Berkeley, 2011).
    Chapter 3, “The Euclidean Algorithm”, section 2, “The fundamental theorem of arithmetic”, p. 186 (the whole topic: pp. 183–188). Read it online.
    “Note that the second part of the theorem is clearly false if m/n is not reduced. For example, 3/6 = 0.5, but the prime decomposition of 6 contains a 3.”
    Used for: the condition is about the denominator in lowest terms: a fraction that is not in lowest terms may have another prime factor in its denominator and still terminate.
  8. 8.
    Eric W. Weisstein, “Regular Number”, MathWorld, a Wolfram Web Resource.
    “For the reduced fraction above, the number of decimal digits after the decimal point in its shortest terminating expansion is”
    Used for: the number of places of the shortest decimal of a fraction in lowest terms is given by the counts of 2s and 5s in its denominator (the formula that follows on the page is the larger of the two counts).
  9. 9.
    David M. Burton, The History of Mathematics: An Introduction (7th ed., McGraw-Hill, 2011).
    Chapter 2, “Mathematics in Early Civilizations”, section 2.5, “Babylonian Mathematics” (“A Tablet of Reciprocals”), p. 63 (the whole topic: pp. 62–64).
    “These tables have certain gaps in them; missing are such numbers as 7, 11, 13, and 14, and some others. The reason is that only finite sexagesimal fractions were comprehensible to the Babylonians, and the reciprocals of these “irregular” numbers are nonterminating”
    Used for: Babylonian tables of reciprocals (in base sixty) omit numbers such as 7, 11, 13 and 14, because only finite sexagesimal fractions were understood and the reciprocals of these irregular numbers do not terminate.