Difference between int and uint and long / ulong Data Types

The primitive data types prefixed with “u” are unsigned versions with the same bit sizes. Effectively, this means they can’t store negative numbers, but alternatively those can store positive numbers twice as large as their signed counterparts. The signed counterparts do not have “u” prefixed.

The limits for int (32 bit) are:

int: –2147483648 to 2147483647
uint: 0 to 4294967295

And for long (64 bit):

long: -9223372036854775808 to 9223372036854775807
ulong: 0 to 18446744073709551615

Leave a Reply

Your email address will not be published. Required fields are marked *