Use unsigned types for:
* Division and remainders
* Loop counters
* Array indexing
Use signed types for:
* Integer-to-float conversion
(p19, chapter 3.)
Things it says (p18, chapter 3):
quote:In many cases, the data stored in integer variables determines whether a signed or an unsigned integer type is appropriate. For example, to record the weight of a person in pounds, no negative numbers are required, so an unsigned type is
appropriate. However, recording temperatures in degrees Celsius may require both positive and negative numbers, so a signed type is needed.
Where there is a choice of using either a signed or an unsigned type, take into consideration that certain operations are faster with unsigned types while others are faster for signed types.
Integer-to-floating-point conversion using integers larger than 16 bits is faster with signed types
Not that it matters much, I guess. I tend to use unsigned ints for most loops, counts and sizes as they usually make more sense as non-negative.
I don''t see this is an especially religious issue (which is why I shouldn''t have made a definitive statement). Use whatever data type makes more sense in the situation (or take the other advice that it should always be signed).