{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreibqfsym5jyzgcm6seberbgvp4a2jwqqh2e7cj2w2hwukqna4aozcm",
    "uri": "at://did:plc:ivbknywyskln22er3nkssdhl/app.bsky.feed.post/3mntuvmhzyat2"
  },
  "path": "/t/infinite-precision-intermediate-arithmetic-how-much-would-break/24383#post_15",
  "publishedAt": "2026-06-09T08:07:44.000Z",
  "site": "https://internals.rust-lang.org",
  "tags": [
    "arbitrary fixed bit-width integers u<N>/i<N>"
  ],
  "textContent": "Vorpal:\n\n> While this might work for arithmetic (though not when retrofitted), what about bit twiddling? It seems error prone to me if the compiler tries to guess the integer width in that type of code.\n\nit's totally possible to figure out the exact range of bit-twiddled values (when working an operator at a time), and from the range you can deduce the width in bits. it is a bit complicated so I'm not going to write it all out here, but e.g. `!v` is just `-1 - v` and `v << s` is just `v * 2.pow(s)`.\n\nI'd want ranged integers `int<min..=max>` and also arbitrary fixed bit-width integers u<N>/i<N>.",
  "title": "Infinite precision intermediate arithmetic: how much would break?"
}