Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between Int32 and UInt32?

Tags:

What is the difference between Int32 and UInt32?

If they are the same with capacity range capabilities, the question is for what reason UInt32 was created? When should I use UInt32 instead of Int32?

like image 230
Fitzchak Yitzchaki Avatar asked Feb 21 '10 20:02

Fitzchak Yitzchaki


2 Answers

UInt32 does not allow for negative numbers. From MSDN:

The UInt32 value type represents unsigned integers with values ranging from 0 to 2 to the power of 32 or 2**32 (which equals to 4,294,967,295).

like image 92
Otávio Décio Avatar answered Sep 22 '22 14:09

Otávio Décio


An integer is -2147483648 to 2147483647 and an unsigned integer is 0 to 4294967295.

This article might help you.

like image 43
Randy Minder Avatar answered Sep 21 '22 14:09

Randy Minder