{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreiaix2sy7z23rqx3tgfsjlbeazagj3ios2i6yop2qgoqceezibknfq",
"uri": "at://did:plc:ivbknywyskln22er3nkssdhl/app.bsky.feed.post/3mnuwtrufs4b2"
},
"path": "/t/infinite-precision-intermediate-arithmetic-how-much-would-break/24383#post_20",
"publishedAt": "2026-06-09T18:18:38.000Z",
"site": "https://internals.rust-lang.org",
"tags": [
"1 + 2 + 3 + 4 + ... = -1/2"
],
"textContent": "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:\n\n\n S = 1 + 2 + 4 + 8 + ...\n\n 2S = 2 + 4 + 8 + 16 + ...\n\n 2S - S = (2 + 4 + 8 + 16 + ...)\n - (1 + 2 + 4 + 8 + ...)\n\n S = -1\n\n\nand thus `0b111...111` being -1 is, in a sense, more mathematically correct than treating it as a sign-magnitude representation.\n\nSo infinite precision bitops are thus really not a problem at all.",
"title": "Infinite precision intermediate arithmetic: how much would break?"
}