uint and ulong are unsigned versions of int and long . This means that they cannot 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 an unsigned literal int in the 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 want CLS compatible .
Read the documentation for more information:
By the way, there are short and ushort and sbyte .
Mark Byers Sep 16 2018-10-06T00: 00Z
source share