Interface SignedInt8
access this type via: data.SignedInt8 (provides, requires or uses)
An object to represent and manipulate signed 64-bit integers (Dana primitive integers are all unsigned). These values are internally stored using two's complement. In general, Dana programs will use only int and dec types for their internal logic and will avoid the use of signed integers; this API is primarily intended to support the import and export of signed integers to external systems or data formats.
Functions
SignedInt8(optional int8 val, int8 neg)
int8 subtract(int8 val)
int8 add(int8 val)
int8 multiply(int8 val)
int8 divide(int8 val)
int8 getValue()
void setValue(int8 v)
bool isNegative()
void invert()
byte[] getBytes()
SignedInt8(optional int8 val, int8 neg)
Creates a new 64-bit signed integer instance, initialised either from an absolute value (val) or from a positive value which should be made negative (neg). An absolute value is assumed not to need any treatment and is set directly as the internal value of the signed integer (via new SignedInt8(n)). This value may either be intended as a positive integer, or a value from the getValue() function of another signed integer instance. A negative value (e.g. using new SignedInt8(neg = n)) is assumed to be a positive unsigned integer at the point of input, such as the value 4, which is converted to a negative value in the SignedInt8 instance, such as -4.
int8 subtract(int8 val)
Subtract a given 64-bit signed integer value from this instance's current value.
int8 add(int8 val)
Add a given 64-bit signed integer value to this instance's current value.
int8 multiply(int8 val)
Multiply this instance's current value by a given 64-bit signed integer value.
int8 divide(int8 val)
Divide this instance's current value by a given 64-bit signed integer value.
int8 getValue()
Get the value of this 64-bit signed integer, as an int4, suitable for use as a parameter to other SignedInt8 instances.
void setValue(int8 v)
Set the value of this 64-bit signed integer.
bool isNegative()
Test is this signed integer instance currently holds a negative value.
void invert()
Invert the sign of this signed integer instance, changing it from positive to negative, or vice-versa.
byte[] getBytes()
Get the raw bytes of this signed integer instance.