# 64-bit signed integers.

.

Euclidean-0 modulus. See `(/):(x : int64std/core/types/int64: V, y : int64std/core/types/int64: V) -> int64std/core/types/int64: V` division for more information.

Multiply two 64-bit integers.

Euclidean-0 division. Euclidean division is defined as: For any `D` and `d` where `d!=0` , we have:

1. `D == d*(D/d) + (D%d)`
2. `D%d` is always positive where `0 <= D%d < abs(d)`

Moreover, Euclidean-0 is a total function, for the case where `d==0` we have that `D%0 == D` and `D/0 == 0` . So property (1) still holds, but not property (2). Useful laws that hold for Euclidean-0 division:

• `D/(-d) == -(D/d)`
• `D%(-d) == D%d`
• `D/(2^n) == sarstd/num/int64/sar: (int64, int64) -> int64(D,n)` (with `0 <= n <= 31`)
• `D%(2n) == D & ((2n) - 1)` (with `0 <= n <= 31`)

Note that an interesting edge case is `min-int64std/num/int64/min-int64: int64 / -1` which equals `min-int64std/num/int64/min-int64: int64` since in modulo 64-bit arithmetic `min-int64std/num/int64/min-int64: int64 == -1 * min-int64std/num/int64/min-int64: int64 == -1 * (min-int64std/num/int64/min-int64: int64 / -1) + (min-int64std/num/int64/min-int64: int64 % -1)` satisfying property (1). Of course `(min-int64std/num/int64/min-int64: int64 + 1) / -1` is again positive (namely `max-int64std/num/int64/max-int64: int64`).

See also Division and modulus for computer scientists, Daan Leijen, 2001 pdf .

Take the bitwise xor of two `int64std/core/types/int64: V`s.

Negate an 64-bit integer.

Return the absolute value of an integer. Raises an exception if the `int64std/core/types/int64: V` is `min-int64std/num/int64/min-int64: int64` (since the negation of `min-int64std/num/int64/min-int64: int64` equals itself and is still negative).

Return the absolute value of an integer. Returns 0 if the `int64std/core/types/int64: V` is `min-int64std/num/int64/min-int64: int64` (since the negation of `min-int64std/num/int64/min-int64: int64` equals itself and is still negative).

Take the bitwise and of two `int64std/core/types/int64: V`s.

The number of bits in an `int64std/core/types/int64: V` (always 64).

Convert an `int64std/core/types/int64: V` to a boolean.

Truncated division (as in C). See also `(/):(x : int64std/core/types/int64: V, y : int64std/core/types/int64: V) -> int64std/core/types/int64: V`.

Truncated modulus (as in C). See also `(%):(x : int64std/core/types/int64: V, y : int64std/core/types/int64: V) -> int64std/core/types/int64: V`.

Decrement a 64-bit integer.

Convert an 64-bit integer to a double.

fun fold-int64( start : int64std/core/types/int64: V, end : int64std/core/types/int64: V, init : a, f : (int64std/core/types/int64: V, a) -> e a ) : e a

Increment a 64-bit integer.

Convert a boolean to an `int64std/core/types/int64: V`.

Returns `true` if the integer `i` is an even number.

Returns `true` if the integer `i` is an odd number.

Return the maximum of two integers.

The maximal integer value before overflow happens.

Return the minimum of two integers.

The minimal integer value before underflow happens.

Negate a 64-bit integer.

Bitwise not of an `int64std/core/types/int64: V`, i.e. flips all bits.

Take the bitwise or of two `int64std/core/types/int64: V`s.

Bitwise rotate an `int64std/core/types/int64: V` `n & 63` bits to the left.

Bitwise rotate an `int64std/core/types/int64: V` `n & 63` bits to the right.

Arithmetic shift an `int64std/core/types/int64: V` to the right by `n & 63` bits. Preserves the sign bit.

Shift an `int64std/core/types/int64: V` `i` to the left by `n & 63` bits.

Convert an `int64std/core/types/int64: V` to a string.

fun show-hex( i : int64std/core/types/int64: V, width : ?intstd/core/types/int: V, use-capitals : ?boolstd/core/types/bool: V, pre : ?stringstd/core/types/string: V ) : stringstd/core/types/string: V

Show an `int64std/core/types/int64: V` in hexadecimal notation The `width` parameter specifies how wide the hex value is where `'0'` is used to align.
The `use-capitals` parameter (= `Truestd/core/types/True: bool`) determines if captical letters should be used to display the hexadecimal digits.
The `pre` (=`"0x"`) is an optional prefix for the number (goes between the sign and the number).

fun show-hex64( i : int64std/core/types/int64: V, width : ?intstd/core/types/int: V, use-capitals : ?boolstd/core/types/bool: V, pre : ?stringstd/core/types/string: V ) : stringstd/core/types/string: V

Show an `int64std/core/types/int64: V` in hexadecimal notation interpreted as an unsigned 64-bit value. The `width` parameter specifies how wide the hex value is where `'0'` is used to align.
The `use-capitals` parameter (= `Truestd/core/types/True: bool`) determines if captical letters should be used to display the hexadecimal digits.
The `pre` (=`"0x"`) is an optional prefix for the number.

Logical shift an `int64std/core/types/int64: V` to the right by `n & 63` bits. Shift in zeros from the left.

Convert an `int64std/core/types/int64: V` to an `intstd/core/types/int: V` but interpret the `int64std/core/types/int64: V` as a 64-bit unsigned value.

Convert an `intstd/core/types/int: V` to `int64std/core/types/int64: V` but interpret the `int` as an unsigned 64-bit value. `i` is clamped between `0` and `0xFFFFFFFFFFFFFFFF`.
`0x7FFFFFFFFFFFFFFF.uint64std/num/int64/uint64: (i : int) -> int64 == 0x7FFFFFFFFFFFFFFF.int64 == max-int64std/num/int64/max-int64: int64`
`0x8000000000000000.uint64std/num/int64/uint64: (i : int) -> int64 == -0x800000000000000.int64 == min-int64std/num/int64/min-int64: int64`
`0xFFFFFFFFFFFFFFFF.uint64std/num/int64/uint64: (i : int) -> int64 == -1.int64`.