Calculating the rational z whose base b digits are given

Here the pre-period, ak-1,...,a0 (if present) and period br-1,...,b0 consist of integers in the range [0,b – 1].
Thus z = ak-1/b + ··· +a0/bk + br-1/bk+1 + ··· +b0/bk+r + ···

If there is no pre-period, simply enter 0 0 in the pre-period box below.

If x = ak-1bk-1 + ··· +a0 and y = br-1br – 1 + ··· +b0, then

z={x(br – 1) + y}/{bk(br – 1)}.

If there is no preperiod, then z=y/(br – 1).

Example. Take b = 10, a0 = 2, a1 = 0, b0 = 1, b1 = 3, so that z = ·023131···.
Then z = 229/9900.

Enter the pre-period digits 0 ≤ ai ≤ b – 1, (or 0 0 if no pre-period), separated by spaces:

Enter the period digits 0 ≤ bj ≤ b – 1, separated by spaces:

Enter b (>1):

Last modified 9th February 2007
Return to main page