For a reduced fraction with , , and coprime integers, its decimal representation repeats immediately after the decimal point. The shortest repeating block has length
Here denotes multiplicative order, and denotes Euler's totient function. Changing the numerator preserves the decimal period as long as the fraction remains reduced.[ref]
For example, long division of gives the remainders , with emitted digits . Consequently
Each remainder determines both the next digit and the next remainder; returning to one restarts the same six steps.
Figure 1.
Long-division remainders explain the six-digit repeat of one seventh and the two-digit prefix of one twenty-eighth
. Details.
More generally, initialize long division with . At each step, division with remainder gives
so . Since are coprime integers, the modular inverse of shows that exactly when . To see why the digit block cannot repeat sooner than the remainders, a purely repeating decimal with a block of digits represents for an integer . A reduced fraction with that value forces . Hence the shortest digit repeat and the multiplicative order coincide.
Knowing the decimal period predicts how many digits must be computed and stored: one block determines the whole repeating decimal. It also constructs the block directly. With , the integer
is the block, padded on the left with zeros to digits. For , and , so the block is and . Reduction matters: has decimal period one, whereas .
If the reduced denominator contains prime factors two or five, ten has no multiplicative order modulo that whole denominator. Write
The decimal preperiod has exactly digits. If , the remaining repeating decimal has decimal period . For instance, gives : two prefix digits, then six repeating digits. If , the decimal representation is a terminating decimal with exactly fractional places. We use the representation ending in zeros, rather than its alternative ending in nines; for example terminates after three places.
A short derivation explains both cases. After digits, multiplying the reduced fraction by and discarding its integer part leaves a reduced fraction whose denominator is . This denominator first becomes coprime to ten at . It then equals , giving an immediate repeat when , or an integer when . The same long division argument works for positional notation in any base : for a reduced denominator coprime to , the shortest repeating block has length .
Decimal representation Created 2026-09-29 Updated 2026-10-14
A decimal representation is positional notation with radix ten and numeral digits zero through nine. For an integer, the nonnegative part is a finite decimal expansion; a negative integer has a separate minus sign. For example, , whereas . The numeral digits alone do not determine the value: their positions do.
Fractional positions extend the same place value rule to the right of the decimal point, with successive weights . [ref] For example,
The matching binary representation is , since its fractional part is . These representations terminate in both bases; finiteness in one radix does not imply finiteness in another.
Leading zeros in the integer part and trailing zeros in the fractional part leave the value unchanged: . A zero appended to the right of an integer string has a different effect: . Keeping the decimal point fixed prevents confusing these two operations.
Every integer has a finite decimal expansion, but a noninteger rational number may need infinitely many fractional numeral digits, as in . A terminating decimal has a zero tail by convention. Infinite decimal strings have a further ambiguity that finite canonical integer strings do not: , because the geometric series sums to one. An infinite decimal tail denotes a limit, not a sufficiently long rounded approximation.