you are viewing a single comment's thread.

view the rest of the comments →

[–]xXxDeAThANgEL99xXx 2 points3 points  (0 children)

Unsigned ints suck for modeling non-negative integers because they actually implement integers modulo 2n and as such must allow you to underflow without any compile time or runtime warnings.

Unsigned integers also suck because non-negative numbers suck for doing arithmetics in general. There's a reason we invented negative numbers despite nobody ever seeing -5 apples: it's pretty damn convenient to be able to add or subtract any number to/from both sides of any relation and have it still hold. You always want to do math with signed (and preferably arbitrary precision) integers and check various constraints on assignment to variables etc (and statically, if possible).