uint
and ulong
are the unsigned versions of int
and long
. That means they can't be negative. Instead they have a larger maximum value.
Type Min Max CLS-compliant int -2,147,483,648 2,147,483,647 Yes uint 0 4,294,967,295 No long –9,223,372,036,854,775,808 9,223,372,036,854,775,807 Yes ulong 0 18,446,744,073,709,551,615 No
To write a literal unsigned int in your source code you can use the suffix u
or U
for example 123U
.
You should not use uint and ulong in your public interface if you wish to be CLS-Compliant.
Read the documentation for more information:
By the way, there is also short and ushort and byte and sbyte.