My previous post ended with a discussion of repeating binary decimals such as

0.00110011…_{two} = 1/5.

For this post I’ll explain how calculations like that are done, how to convert a repeating decimal in any base to a fraction.

First of all, we only need to consider repeating decimals of the form

0.1_{b}, 0.01_{b}, 0.001_{b}, etc.

because every repeating decimal is an integer times an expression like one above. For example,

0.424242… = 42 × 0.010101…

You can think of that example as base 10, but it’s equally true in any base that has a 4, i.e. any base greater than 4.

Now suppose we have an expression

in base *b*.

We can see that this expressions is

by summing a geometric series.

So going back to our example above,

If we’re working in base 10, this equals 1/99. If we’re working in hexadecimal, this is 1/FF_{hex} = 1/255.

I’ll finish with a duodecimal example. Suppose we have

0.7AB7AB7AB…_{twelve}

and want to convert it to a fraction. We have

Or 1139/1727 in base 10.