logoalt Hacker News

CodesInChaosyesterday at 11:36 PM2 repliesview on HN

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.


Replies

bigstrat2003today at 4:47 AM

I 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.

vhcrtoday at 1:52 AM

Or using the saturating methods.