The infinite sum involving powers of two is actually true in the 2-adic integers.
Those infinite series aren't divergent if you are measuring their size p-adically.
Gouvea's book actually goes through the things that RobAlni has just discovered.
It turns out a lot of ideas from calculus and real analysis carry over to the 2-adics, and this can lead to some interesting computational shortcuts since two’s complement is essentially native 2-adic arithmetic. I’ve blogged a bit about this here: https://kevinventullo.com/