r/C_Programming • • Jun 15 '26

Question Question regarding unsigned integers

What's the difference between an unsigned int and a normal integer?

11 Upvotes

93 comments sorted by

View all comments

Show parent comment

1

u/flatfinger Jun 15 '26

The published Rationale suggests the reason that the Standard doesn't specify that an expression like uint1 = ushort1*ushort2; should use unsigned math even if all values of unsigned short can be represented as signed int is not that nobody knew how implementations for common hardware should process results between INT_MAX+1u and UINT_MAX, but rather that they had always processed such cases the same way and there was no reason to expect that in the absence of a mandate they might do otherwise.