NAME

src/pmc/bigint.pmc - BigInt PMC class

DESCRIPTION

BigInt provides arbitrary precision integer mathematic functions.

Functions

static void bigint_set_long(Interp*, PMC *, long value)
static void bigint_set_double(Interp*, PMC *, double value)

Methods

METHOD version()
Return GMP version string "x.y.z".
PMC *instantiate(PMC *sig)
Object constructor. SELF is a BigInt Class object. Return a new BigInt object.
void set_integer_native(INTVAL value)
void set_number_native(FLOATVAL value)
Sets the value of the bigint to value.
void set_string_native(STRING *value)
Sets the value of the integer to the result of converting *value to a number.
void set_string_keyed_int(INTVAL base, STRING *value)
Same assume number base base.
void set_pmc(PMC *value)
Sets the value of the integer to the integer value of *value.
FLOATVAL get_number()
Returns the value of the integer as a floating point number.
INTVAL get_integer()
Returns the value of the integer.
PMC *get_bignum()
Returns SELF
INTVAL get_bool()
Returns the boolean value of the integer.
STRING *get_string()
Returns the string representation of the integer.
STRING *get_string_keyed_int(INTVAL base)
Returns the string representation of the integer in base base.
STRING *get_repr()
Returns the string representation of the integer with the letter 'L' appended.
void increment()
Increments the integer.
void decrement()
Decrements the integer.
PMC *absolute(PMC *dest)
void i_absolute()
Sets dest to the absolute value of SELF.
PMC *neg(PMC *dest)
void i_neg()
Set dest to the negated value of SELF.
PMC *bitwise_shl(PMC *value, PMC *dest)
PMC *bitwise_shl_int(INTVAL value, PMC *dest)
Returns in *dest the shift left of the BigInt by *value.
void i_bitwise_shl(PMC *value)
void i_bitwise_shl_int(INTVAL value)
Inplace shift left.
PMC *bitwise_shr(PMC *value, PMC *dest)
PMC *bitwise_shr_int(INTVAL value, PMC *dest)
Returns in *dest the shift right of the BigInt by *value.
void i_bitwise_shr(PMC *value)
void i_bitwise_shr_int(INTVAL value)
Inplace shift left.