UInt128 Data Type

Holds unsigned 128-bit (16-byte) integer values with a maximum of 39 decimal digits. That is 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, you find the result as follows:

number Mod UInt128.Max + 1
Automatic conversions
UInt128 widens to Real32, Real64, or Real128 without risk of overflow.
Type characters
You can put the suffix u128 (or U128) on the end of an integer literal. But there are no type characters for names.

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 #format As Format) As UInt128
Tries to parse a string that shows as an integer.
If #fnt is not given or is #Null, it tries to parse str as a decimal (base-10) integer. Or you can make it clear with Format.Base10.
UInt128.Size As Int32
Returns the number of available bytes. This is always 16.

Examples

Example 1

Dim foo As UInt128

Example 2

Var low = 0u128, high = 100u128
Var result = low - high
After run
low 0 (%X00000000000000000000000000000000)
high 100 (%X00000000000000000000000000000064)
result 340282366920938463463374607431768211356 (%XFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9C)

See also