Re:My first verified imperative program
by andrepd on Monday July 07, 2025 @04:55PM
(#44494585)
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.
[ Parent
| on HN ]
We 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.
Re:My first verified imperative program
by alternatex on Tuesday July 08, 2025 @10:44AM
(#44500477)
Overflow/underflow does happen in C# though. You have to manually opt-out by using a `checked` block anywhere you do arithmetic.