3 ms·
Are you sure? IIRC overflow or underflow is always UB per the (earlier?) C standards; they did not expect a single popular representation system for numbers.
by R0b0t1 6y ago
Are you sure? IIRC overflow or underflow is always UB per the (earlier?) C standards; they did not expect a single popular representation system for numbers.
- MaxBarraclough 6y agoYes, I'm quite sure. C mandates that unsigned integer types use the typical binary representation, and it mandates wrapping arithmetic. I don't know much about the early C standards, it's possible it wasn't always this way. https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?pageId=87152052 https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?pa... https://stackoverflow.com/a/18195756/ https://stackoverflow.com/a/18195756/