The decimal expansion of a rational number is either terminating or non-terminating repeating (or recurring) without knowing when it is terminating and when it is non-terminating repeating. In this section, we will explore exactly when the expansion of decimal of a rational number is terminating and when it is non-terminating repeating.
1) 0.125 = 125/1000 = 125/10^{3} = 5^{3}/(2^{3} x 5^{3}) = 1/2^{3}
2) 0.00134 = 134/100000 = 134/10^{5} = (2 x 67)/(2^{5} x 5^{5} ) = 67/(2^{4} x 5^{5} )
3) 0.7 = 7/10 = 7/(2 x 5) Note : As we know that 2 and 5 are the only prime factors of 10.

1) Theorem 1: Let x be a rational number whose expansion of decimal terminates. Then x can be expressed in the form p/q, where p and q are co-prime, and the prime factorization of q is of the form 2^{n}5^{m}, where n, m are non-negative integers.

2) Theorem 2 : Let x = p/q be a rational number, such that the prime factorization of q is of the form 2^{n}5^{m}, where n, m are non-negative integers. Then x has a expansion of decimal which terminates.

3) Let x =p/q be a rational number, such that the prime factorization of q is not of the form 2^{n}5^{m}, where n, m are non-negative integers. Then, x has a expansion of decimal which is non-terminating repeating (recurring).

Examples :

1) State whether the following rational numbers will have terminating decimal-expansion or a non-terminating repeating expansion of decimal.
a) 17/8 Solution :
17/8 = 17/(2^{3} x 5^{0})
As the denominator is of the form 2^{n}5^{m} so the expansion of decimal of 17/8 is terminating.
-----------------------------------------------------------------------------
b) 64/255 solution :
64/255 = 64/ (5 x 3 x 17)
Clearly, 255 is not of the form 2^{n}5^{m}. So, the expansion of decimal of 64/255 is non-terminating repeating.
Euclid's Geometry