Let's look at it from a practical angle.
For better or worse, a signed int is the regular int type used in .NET. It was also fine to use signed int in C and C ++. Thus, most variables are declared int , not unsigned int , unless there is a good reason.
Converting between unsigned int and signed int has problems and is not always safe.
On a 32-bit system, a collection cannot contain about 2 ^^ 32 elements , so the signed int is large enough in all cases .. p>
On a 64-bit system, you don’t have much unsigned int , and in most cases the signed int is still large enough, otherwise you need to use the 64-bit int . (I expect that no standard collection will cope well with any objects around 2 ^^ 31 in system 64!)
Therefore, given that using unsigned int does not have a clear advantage, why are you using unsigned int ?
Ian Ringrose Sep 07 '10 at 13:24 2010-09-07 13:24
source share