UInt64
Data Type
Holds unsigned 64-bit (8-byte) integer values with a maximum of 20 decimal digits. That is in the range 0–18,446,744,073,709,551,615.
Instructions
- Default value
- When you declare a variable of type
UInt64
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 UInt64.Max + 1
- Automatic conversions
UInt64
widens toInt128
,UInt128
,Real32
,Real64
, orReal128
without risk of overflow.- Type characters
- You can put the suffix
u64
(orU64
) on the end of an integer literal. But there are no type characters for names.
Shared methods and properties
UInt64.Default As UInt64
- Returns the default value,
0
. UInt64.Max As UInt64
- Returns the maximum positive value.
UInt64.Min As UInt64
- Returns the minimum value. This is always zero (0)
UInt64.Parse(str As String, Optional #format As Format) As UInt64
- Tries to parse a string that shows as an integer.
- If
#format
is not given or is#Null
, it tries to parsestr
as a decimal (base-10) integer. Or you can make it clear withFormat.Base10
. UInt64.Size As Int32
- Returns the number of available bytes. This is always 8.
Examples
Example 1
Dim foo As UInt64
Example 2
Dim low As UInt64 = 0, high As UInt64 = 100
Dim result As UInt64 = low - high
low |
0 (%X0000000000000000) |
---|---|
high |
100 (%X0000000000000064) |
result |
18446744073709551516 (%XFFFFFFFFFFFFFF9C) |