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

5

u/pjl1967 Jun 15 '26

Strictly speaking (i.e., in math), 0 is neither positive nor negative. In twos complement, it's de facto positive; in (rare) ones complement, there is actually positive and negative 0.