3 ms·
I'm not convinced that it would have been any more obvious to the person who made the error that the variable could overflow if it were unsigned. It's also muc
by sleepydog 6y ago
I'm not convinced that it would have been any more obvious to the person who made the error that the variable could overflow if it were unsigned.
It's also much easier, IMO, to accidentally underflow an unsigned integer; it's so much more common to work with 0 than it is to work with +/- 2 billion.
- karagenit 6y agoI'm being pedantic, but technically wrapping from 0 to MAX_INT is still considered overflow. Underflow refers to decimal truncation e.g. by integer division.