The partial sum limits to 2 (it's a convergent geometric series with a = 1, r = 1 / 2), so instead of completing the loop you might as well just use the explicit formula for the mth partial sum 2 - (1 / (2 ^ m)) where m = 5.
It's also quite interesting in binary:
(1/2)^0 is 1
(1/2)^1 is 0.1 (in binary)
(1/2)^2 is 0.01 (in binary)
(1/2)^3 is 0.001 (in binary)
etc.
Your sum for i=0 to i=5 is just
1.11111 (in binary)
and all the other partial sums are similar.
For fractions other than the inverse powers of 2 you can, as @mbozzi points out, more quickly use the formula for the sum of a geometric series than doing the sum term by term.