-
Notifications
You must be signed in to change notification settings - Fork 3
Integers 64
Christopher Ross-Gill edited this page Aug 1, 2016
·
1 revision
Minimum value: -9'223'372'036'854'775'808
equal to: - (2 ** 63)
Maximum value: 9'223'372'036'854'775'807
equal to: (2 ** 63) - 1
It's problematic to produce those values with the help of decimals, because of decimal precision. This works:
min-int: to integer! negate 2 ** 63
While this produces a number overflow:
max-int: to integer! 2 ** 63 - 1
The reason is, that the power operator (**) returns a decimal, which doesn't have all the precision needed.
Other ways that work:
min-int: to integer! #8000000000000000 min-int: to integer! #{8000 0000 0000 0000} min-int: (negate to integer! 2 ** 62) - (to integer! 2 ** 62) max-int: to integer! #7FFFFFFFFFFFFFFF max-int: to integer! #{7FFF FFFF FFFF FFFF} max-int: (to integer! 2 ** 62) - 1 + (to integer! 2 ** 62)