r/C_Programming • u/Low_Minimum9920 • Jun 15 '26
Question Question regarding unsigned integers
What's the difference between an unsigned int and a normal integer?
11
Upvotes
r/C_Programming • u/Low_Minimum9920 • Jun 15 '26
What's the difference between an unsigned int and a normal integer?
View all comments
Show parent comment
1
u/WittyStick Jun 16 '26
The math is the same for addition, subtraction, comparison, but it isn't the same for multiplication, division and right shift.
Some architectures have traps for certain over/underflow ops - eg, division on x86-64 will trap.