Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Agreed. If anything, I'd like to have an unsigned type with undefined overflow so that I can get these benefits while also guaranteeing that the numbers are never negative where that doesn't make any sense.


That's what zig did, and they solved the overflow problem by having seperate operators for addition and subtraction that guarantee that the number saturates/wraps on overflow.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: