As explained in recurring decimals, whenever an irreducible fraction is written in radix point notation in any base, the fraction can be expressed exactly ( terminates ) if and only if all the prime factors of its denominator are also prime factors of the base.