3 ms·
Many safe languages still suffer from integer overflows. For example in Rust and C# you can pick between an exception being thrown, or silent wrapping when an o
by CodesInChaos 13d ago
Many safe languages still suffer from integer overflows. For example in Rust and C# you can pick between an exception being thrown, or silent wrapping when an overflow happens.
- vhcr 13d agoOr using the saturating methods.
- bigstrat2003 13d agoI don't think that's suffering at that point. The programmer has made an explicit decision to let things overflow, so he should be prepared to handle that possibility. It's not like a language where overflow happens silently without warning.