UInt128 Data Type

Holds unsigned 128-bit (16-byte) integer values in the range 0–340,282,366,920,938,463,463,374,607,431,768,211,455.

Instructions

Default value
When you declare a variable of type UInt128 and do not initialize it, its default value is zero (0).
Negation

If you use the negation operator (-) on an unsigned type, ViviFire gives a warning that this operation is usually an error.

If you subtract a larger number from a smaller number, the result is calculated as follows:

number Mod UInt128.Max + 1
Type changes
UInt128 widens to Real32, Real64, Real, or Real128 without risk of overflow.
Type characters
UInt128 has no type characters.

Shared methods and properties

uInt128.Default As UInt128
Returns the default value, 0.
UInt128.Max As UInt128
Returns the maximum positive value.
UInt128.Min As UInt128
Returns the minimum value. This is always zero (0)
UInt128.Parse(str As String, Optional #fmt As Format) As UInt128
Tries to parse a string that shows as an integer.
If #fnt is not given or is #Null, then it tries to parse str as a decimal (base-10) integer. Or you can be explicit with Format.Base10.
UInt128.Size As Int
Returns the number of available bytes. This is always 16.

Examples

Example 1

Dim foo As UInt128

Example 2

Dim low As UInt64 = 0, high As UInt64 = 100
Dim result As UInt64 = low - high
After execution
VariableValue
low0 (&H00000000000000000000000000000000)
high100 (&H00000000000000000000000000000064)
result340282366920938463463374607431768211356 (&HFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9C)

See also