It's unfortunate that the world standardized on integer overflow not giving an error. Error on integer overflow should have been the default behavior, with programmers having to explicitly choose wrapping without overflow when that was desired.
Of course, that would also have required explicit signed and unsigned arithmetic operations, because overflow (and underflow) differ for signed vs. unsigned.
Now the no-overflow-error behavior is entrenched in C and C++.
Conversation
Notices
-
🇺🇦 haxadecimal (brouhaha@mastodon.social)'s status on Wednesday, 11-Jan-2023 12:23:47 JST 🇺🇦 haxadecimal