2 ms·
But false is the correct result for those cases. Addition is addition and overflow is undefined (= can assume that doesn't happen), it's not addition modulo 2^n
by andrepd 1y ago
But false is the correct result for those cases. Addition is addition and overflow is undefined (= can assume that doesn't happen), it's not addition modulo 2^n.
- Joker_vD 1y agoWe are not talking about C here. Imagine it was e.g. Java, or C#, or Rust in release mode, or heck, even Lean itself but with fixed-precision integers.
- alternatex 1y agoOverflow/underflow does happen in C# though. You have to manually opt-out by using a `checked` block anywhere you do arithmetic.