NAME ^

classes/integer.pmc - Integer PMC class

DESCRIPTION ^

Integer provides an integer for languages that want a value-restricted integer type without going to an I register.

Functions ^

void init()

Initializes the integer with a default value of 0.

PMC *instantiate()

Class method to construct an Integer according to passed arguments.

void share()

FLOATVAL get_number()

Returns the floating-point value of the integer.

BIGNUM *get_bignum()

Unimplemented. Returns NULL.

STRING *get_string()

Returns the string value of the integer.

void morph(INTVAL type)

Morphs the scalar to the specified type.

void set_pmc(PMC *value)

Sets the PMC *value, calling the appropriate set_* method according to the type of *value.

void set_integer_same(PMC *value)

void set_integer_native(INTVAL value)

Sets the value of the integer to the value of the Integer *value.

void set_number(PMC *value)

Morphs the integer to a Float and sets the value from *value.

void set_number_native(FLOATVAL value)

Morphs the integer to a Float and sets the value from value.

void set_bignum(PMC *value)

void set_bool(INTVAL value)

void set_bignum_native(BIGNUM *value)

void set_string (PMC *value)

void set_string_native(STRING *value)

Sets the value of the integer to *value.

void add_int(INTVAL value, PMC *dest)

void add(PMC *value, PMC *dest)

Adds value to the integer and returns the result in *dest.

Please note: the label syntax MMD_type: denote the behavior, if the right hand value is of that type. The part inside the braces is converted to a distinct function and gets mmd_registered for these two types.

void subtract(PMC *value, PMC *dest)

Subtracts *value from the integer and returns the result in *dest.

void subtract_int(INTVAL value, PMC *dest)

Subtracts value from the integer and returns the result in *dest.

void multiply(PMC *value, PMC *dest)

Multiplies the integer by *value and returns the result in *dest.

void multiply_int(INTVAL value, PMC *dest)

Multiplies the integer by value and returns the result in *dest.

void divide(PMC *value, PMC *dest)

void floor_divide(PMC *value, PMC *dest)

Divides the integer by *value and returns the result in *dest.

void divide_int(INTVAL value, PMC *dest)

Divides the integer by value and returns the result in *dest.

void floor_divide_int(INTVAL value, PMC *dest)

Divides the integer by value and returns the result in *dest.

void cmodulus(PMC *value, PMC *dest)

Calculates the value of the integer C-style mod *value and returns the result in *dest.

void cmodulus_int(INTVAL value, PMC *dest)

Calculates the value of the integer C-style mod value and returns the result in *dest.

void modulus(PMC *value, PMC *dest)

Calculates the value of the integer mod *value and returns the result in *dest.

void modulus_int(INTVAL value, PMC *dest)

Calculates the value of the integer mod value and returns the result in *dest.

void neg(PMC *dest)

Set dest to the negated value of SELF.

void bitwise_or(PMC *value, PMC *dest)

Calculates the bitwise OR of the integer and *value and returns the result in *dest.

void bitwise_or_int(INTVAL value, PMC *dest)

Calculates the bitwise OR of the integer and value and returns the result in *dest.

void bitwise_and(PMC *value, PMC *dest)

Calculates the bitwise AND of the integer and *value and returns the result in *dest.

void bitwise_and_int(INTVAL value, PMC *dest)

Calculates the bitwise AN of the integer and *value and returns the result in *dest.

void bitwise_xor(PMC *value, PMC *dest)

Calculates the bitwise XOR of the integer and *value and returns the result in *dest.

void bitwise_xor_int(INTVAL value, PMC *dest)

Calculates the bitwise XOR of the integer and value and returns the result in *dest.

void bitwise_not(PMC *dest)

Calculates the bitwise NOT of the integer and returns the result in *dest.

void bitwise_shr(PMC *value, PMC *dest)

Calculates the bitwise shift right (<<>>>>) of the integer by *value and returns the result in *dest.

void bitwise_shr_int(INTVAL value, PMC *dest)

Calculates the bitwise shift right (<<>>>>) of the integer by value and returns the result in *dest.

void bitwise_shl(PMC *value, PMC *dest)

Calculates the bitwise shift left (<<<<>>) of the integer by *value and returns the result in *dest.

void bitwise_shl_int(INTVAL value, PMC *dest)

Calculates the bitwise shift left (<<<<>>) of the integer by value and returns the result in *dest.

INTVAL is_equal (PMC *value)

The == operation.

INTVAL cmp(PMC *value)

Returns the result of comparing the integer with *value.

INTVAL cmp_num(PMC *value)

Returns the result of numerically comparing the integer with *value.

void logical_not(PMC *value)

Calculates the logical negation of the integer and returns the result in *value.

void increment()

Increments the integer.

void decrement()

Decrements the integer.

void absolute()

Sets dest to the absolute value of SELF.

void freeze(visit_info *info)

Used to archive the integer.

void thaw(visit_info *info)

Used to unarchive the integer.


parrot