logoalt Hacker News

enqkyesterday at 7:30 PM1 replyview on HN

yeah unsigned are really about opting to perform modular arithmetic, or for mapping hardware registers.

C is weakly typed, the basic types are really not to maintain invariants or detect their violation


Replies

AlotOfReadingtoday at 1:23 AM

If you need saturating arithmetic, C23 adds that as well with a new header: https://en.cppreference.com/w/c/header/stdckdint