Re:Efficient Integer Overflow Checking in LLVM (2016)
by MaxBarraclough on Thursday September 24, 2020 @06:06AM
(#24577047)
Oops, you're right! I forgot Java arithmetic wraps, offering (rarely used) methods for overflow-checked arithmetic. [0]
I was right about .Net though. Assuming a checked context, .Net (and C#) throw on overflow, rather than wrapping. [1]
[0] https://docs.oracle.com/en/java/javase/11/docs/api/java.base...
[1] https://docs.microsoft.com/en-us/dotnet/csharp/language-refe...
Are you maybe mixing this up with array bounds checking?