External Publication
Visit Post

Infinite precision intermediate arithmetic: how much would break?

Rust Internals [Unofficial] June 9, 2026
Source

One reason that twos-complement ends up working well is that in the same sense as 1 + 2 + 3 + 4 + ... = -1/2, you can easily see that 1 + 2 + 4 + 8 + ... = -1:

 S = 1 + 2 + 4 + 8 + ...

2S = 2 + 4 + 8 + 16 + ...

2S - S =       (2 + 4 + 8 + 16 + ...)
         - (1 + 2 + 4 + 8 + ...)

     S = -1

and thus 0b111...111 being -1 is, in a sense, more mathematically correct than treating it as a sign-magnitude representation.

So infinite precision bitops are thus really not a problem at all.

Discussion in the ATmosphere

Loading comments...