UInteger Data Type
Updated: July 20, 2015
Holds unsigned 32-bit (4-byte) integers ranging in value from 0 through 4,294,967,295.
UInteger data type provides the largest unsigned value in the most efficient data width.
The default value of
UInteger is 0.
Integer data types provide optimal performance on a 32-bit processor, because the smaller integer types (
SByte), even though they use fewer bits, take more time to load, store, and fetch.
Negative Numbers. Because
UIntegeris an unsigned type, it cannot represent a negative number. If you use the unary minus (
-) operator on an expression that evaluates to type
UInteger, Visual Basic converts the expression to
CLS Compliance. The
UIntegerdata type is not part of the Language Independence and Language-Independent Components (CLS), so CLS-compliant code cannot consume a component that uses it.
Interop Considerations. If you are interfacing with components not written for the .NET Framework, for example Automation or COM objects, keep in mind that types such as
uintcan have a different data width (16 bits) in other environments. If you are passing a 16-bit argument to such a component, declare it as
UIntegerin your managed Visual Basic code.
UIntegerdata type widens to
Double. This means you can convert
UIntegerto any of these types without encountering a System.OverflowException error.
Type Characters. Appending the literal type characters
UIto a literal forces it to the
UIntegerhas no identifier type character.
Framework Type. The corresponding type in the .NET Framework is the System.UInt32 structure.