Comment by enqk
13 hours ago
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
13 hours ago
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
If you need saturating arithmetic, C23 adds that as well with a new header: https://en.cppreference.com/w/c/header/stdckdint