Given a binary number that repeats, for example 0.(0011) or 0.0(101), how would one go about converting it to decimal?
What I've been able to dig up so far is the simple method for converting a terminating binary number to decimal, as below:
res(N+2) = res(N+1) / 2 + res(N)
where res is the result after step N, and N is the current iteration (N=0; n->(num binary digits)). Applying that repeatedly to a nonterminating binary number gives a good approximation, for example
dec:0.4 || bin: 0.(0110):
0 / 2 + 0 = 0
0 / 2 + 0 = 0
0 / 2 + 1 = 1
1/2 / 2 + 1 = 3/2
3/2 / 2 + 0 = 3/4
3/4 / 2 + 0 = 3/8
3/8 / 2 + 1 = 19/16
19/16 / 2 + 1 = 51/32
51/32 / 2 + 0 = 51/64
51/64 / 2 + 0 = 51/128 = 0.3984
which is approximately 0.4.
So, I've got a means of calculating approximates, but I'm struggling with finding a way to express this. I've started trying to write it as a series I can compute at the limit as n->inf without too much success so far.