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

Use unsigned.

All of the mathematical operations are defined on unsigned int in C. This is not true of int.

Compilers are now starting to do all manner of nasty optimizations on undefined behavior. It is now only a matter of time before an signed int burns you.




1u/0u




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

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

Search: