Int64
Info
Dependencies:
- None
Implementation:
Int64.d on GitHub
Int64 implements basic arithmetic for 64-bit integers based on machine code (hence the function signatures are also in machine code style). Furthermore, Int64 offers the constructor int64@
for Int64 objects, but mk64 expects a pointer, not a handle.
Initialization
N/A
Functions
mk64
mk64
Writes lo
and hi
in one place (dest). Makes Int64, hi
has to be -1
for negative 32bit lo
.
var int dest
A pointer to an Int64 object or just 8 bytes of free memory.var int hi
High part of integer.var int lo
Low part of integer.
Examples
Function looks like that:
9876543210
low part should be set to 1286608618
and the high part to 2
neg64
neg64
Negates the integer: *dest <- -(*dest)
var int dest
A pointer to an Int64 object or just 8 bytes of free memory.
add64
add64
Adds src
to dest
: *dest <- *dest + *src
var int dest
A pointer to an Int64 object or just 8 bytes of free memory. Will be changed.var int src
A pointer to an Int64 object. Will not change.
sub64
sub64
Subtracts src
from dest
: *dest <- *dest - *src
var int dest
A pointer to an Int64 object or just 8 bytes of free memory. Will be changed.var int src
A pointer to an Int64 object. Will not change.
mul64
mul64
Multiplies dest
by src
: *dest <- (*dest) * (*src)
var int dest
A pointer to an Int64 object or just 8 bytes of free memory. Will be changed.var int src
A pointer to an Int64 object. Will not change.
div64
div64
Divides dest
by src
: *dest <- *dest / *src
var int dest
A pointer to an Int64 object or just 8 bytes of free memory. Will be changed.var int src
A pointer to an Int64 object. Will not change.