offbrand
A collection of generic, reference counted datastructures in C for C
|
obint Public Interface More...
Go to the source code of this file.
Typedefs | |
typedef struct obint_struct | obint |
Functions | |
obint * | obint_new (int64_t num) |
Creates a new obint with the given integer. More... | |
int64_t | obint_value (const obint *a) |
Returns the value stored in obint as an integer. More... | |
obint * | obint_from_string (const obstring *numstr) |
Creates a new obint with value indicated by given string. More... | |
obstring * | obint_to_string (const obint *a) |
Creates an instance of obstring containing a string representation of the value of an obint. More... | |
obint * | obint_copy (const obint *a) |
Creates an instance of obint with the same value as the argument obint. More... | |
uint8_t | obint_is_zero (const obint *a) |
Checks if an instance of obint is zero and returns the boolean truth value. More... | |
uint8_t | obint_is_negative (const obint *a) |
Checks if an instance of obint is negative and returns the boolean truth value. More... | |
obint * | obint_add (const obint *a, const obint *b) |
Creates a new obint containing the sum of two obint values. More... | |
obint * | obint_add_primitive (const obint *a, int64_t b) |
Creates a new obint containing the sum of an obint and a machine integer. More... | |
obint * | obint_subtract (const obint *a, const obint *b) |
Creates a new obint containing the difference of two obint values. More... | |
obint * | obint_subtract_primitive (const obint *a, int64_t b) |
Creates a new obint containing the difference of an obint and a machine integer. More... | |
obint * | obint_multiply (const obint *a, const obint *b) |
Creates a new obint containing the product of two obint values. More... | |
obint * | obint_multiply_primitive (const obint *a, int64_t b) |
Creates a new obint containing the product of an obint and a machine integer. More... | |
obint * | obint_divide (const obint *a, const obint *b) |
Creates a new obint containing the quotient resule of integer division between two obint values,. More... | |
obint * | obint_divide_primitive (const obint *a, int64_t b) |
Creates a new obint containing the quotient of an obint and a machine integer. More... | |
obint * | obint_mod (const obint *a, const obint *b) |
Creates a new obint containing the remainder of integer division between two obint values,. More... | |
obint * | obint_mod_primitive (const obint *a, int64_t b) |
Creates a new obint containing the remainder of integer division of an obint and a machine integer. More... | |
obint Public Interface
typedef struct obint_struct obint |
Class type declaration
Creates a new obint containing the sum of two obint values.
a | A non-NULL pointer to type obint |
b | A non-NULL pointer to type obint |
Creates a new obint containing the sum of an obint and a machine integer.
a | A non-NULL pointer to type obint |
b | A signed 64 bit machine integer |
Creates an instance of obint with the same value as the argument obint.
a | A non-NULL pointer to type obint |
Creates a new obint containing the quotient resule of integer division between two obint values,.
a | A non-NULL pointer to type obint |
b | A non-NULL pointer to type obint |
Creates a new obint containing the quotient of an obint and a machine integer.
a | A non-NULL pointer to type obint |
b | A signed 64 bit machine integer |
Creates a new obint with value indicated by given string.
numstr | A non-NULL pointer to an obstring instance containing only digit characters and possibly one '-' character at the beginning of the string to indicate a negative value |
uint8_t obint_is_negative | ( | const obint * | a) |
Checks if an instance of obint is negative and returns the boolean truth value.
a | A non-NULL pointer to type obint |
0 | The argument is positive |
non-zero | The argument is negative |
uint8_t obint_is_zero | ( | const obint * | a) |
Checks if an instance of obint is zero and returns the boolean truth value.
a | A non-NULL pointer to type obint |
0 | The argument is non-zero |
non-zero | The argument is zero |
Creates a new obint containing the remainder of integer division between two obint values,.
a | A non-NULL pointer to type obint |
b | A non-NULL pointer to type obint |
Creates a new obint containing the remainder of integer division of an obint and a machine integer.
a | A non-NULL pointer to type obint |
b | A signed 64 bit machine integer |
Creates a new obint containing the product of two obint values.
a | A non-NULL pointer to type obint |
b | A non-NULL pointer to type obint |
Creates a new obint containing the product of an obint and a machine integer.
a | A non-NULL pointer to type obint |
b | A signed 64 bit machine integer |
obint* obint_new | ( | int64_t | num) |
Creates a new obint with the given integer.
num | Integer value for new obint |
Creates a new obint containing the difference of two obint values.
a | A non-NULL pointer to type obint |
b | A non-NULL pointer to type obint |
Creates a new obint containing the difference of an obint and a machine integer.
a | A non-NULL pointer to type obint |
b | A signed 64 bit machine integer |
Creates an instance of obstring containing a string representation of the value of an obint.
a | A non-NULL pointer to type obint |
int64_t obint_value | ( | const obint * | a) |
Returns the value stored in obint as an integer.
a | A non-NULL pointer to type obint |