NAME
src/pmc/scalar.pmc - Scalar Abstract Superclass
DESCRIPTION
These are the vtable functions for the scalar base PMC class
Methods
void assign_pmc(PMC *value)
Sets the PMC
*value,
calling the appropriate set_* method according to the type of *value.Mathematical Methods
PMC *subtract(PMC *value, PMC *dest)void add(PMC *value, PMC *dest)void add_int(INTVAL value, PMC *dest)void add_float(FLOATVAL value, PMC *dest)
Adds void i_add(PMC *value)void i_add(INTVAL value)void i_add(FLOATVAL value)
Adds PMC *subtract(PMC *value, PMC *dest)PMC *subtract_int(INTVAL value, PMC *dest)PMC *subtract_float(FLOATVAL value, PMC *dest)
Subtracts void i_subtract(PMC *value)void i_subtract_int(INTVAL value)void i_subtract_float(FLOATVAL value)
Subtracts PMC *multiply(PMC *value, PMC *dest)PMC *multiply_int(INTVAL value, PMC *dest)PMC *multiply_float(FLOATVAL value, PMC *dest)
Multiplies the number by PMC *divide(PMC *value, PMC *dest)PMC *divide_int(INTVAL value, PMC *dest)PMC *divide_float(FLOATVAL value, PMC *dest)
Divides the number by void i_divide(PMC *value)void i_divide_int(INTVAL value)void i_divide_float(FLOATVAL value)
Divides PMC *floor_divide(PMC *value, PMC *dest)PMC *floor_divide_int(INTVAL value, PMC *dest)PMC *floor_divide_float(FLOATVAL value, PMC *dest)
Divides the number by void i_floor_divide(PMC *value)void i_floor_divide_int(INTVAL value)void i_floor_divide_float(FLOATVAL value)
Divides PMC *modulus(PMC *value, PMC *dest)PMC *modulus(INTVAL value, PMC *dest)PMC *modulus(FLOATVAL value, PMC *dest)
Calculates the value of corrected void i_modulus(PMC *value)void i_modulus(INTVAL value)void i_modulus(FLOATVAL value)
Calculates modulus inplace
PMC *pow(PMC *value, PMC *dest)PMC *pow_int(INTVAL value, PMC *dest)PMC *pow_float(FLOATVAL value, PMC *dest)
Calculates void i_pow(PMC *value)void i_pow_int(INTVAL value)void i_pow_float(FLOATVAL value)
Calculates pow inplace
PMC *neg(PMC *dest)void i_neg()
Set
value to the number and returns the result in *dest.
If dest is NULL it's created.
value to SELF inplace.
value from the number and returns the result in *dest.
If dest doesn't exist a new Float is created.
value from SELF inplace.
value and returns the result in *dest.
value and returns the result in *dest.
SELF by value inplace.
value and returns the result in *dest.
SELF by value inplace.
mod value and returns the result in dest.
See also ops/math.ops.
SELF pow value and returns the result in dest.
See also ops/math.ops.
dest to the negated value of SELF.Bitwise Methods
PMC *bitwise_or(PMC *value, PMC *dest)PMC *bitwise_or_int(INTVAL value, PMC *dest)
Returns in void i_bitwise_or(PMC *value)void i_bitwise_or_int(INTVAL value)
Inplace bitwise or.
PMC *bitwise_and(PMC *value, PMC *dest)PMC *bitwise_and_int(INTVAL value, PMC *dest)
Returns in void i_bitwise_and(PMC *value)void i_bitwise_and_int(INTVAL value)
Inplace bitwise and.
void bitwise_xor(PMC *value, PMC *dest)void bitwise_xor_int(INTVAL value, PMC *dest)
Returns in void i_bitwise_xor(PMC *value)void i_bitwise_xor_int(INTVAL value)
Inplace bitwise and.
PMC *bitwise_not(PMC *dest)void i_bitwise_not()
Returns in PMC *bitwise_shr(PMC *value, PMC *dest)PMC *bitwise_shr_int(INTVAL value, PMC *dest)
Returns in void i_bitwise_shr(PMC *value)void i_bitwise_shr_int(INTVAL value)
Inplace shift right.
A negative PMC *bitwise_lsr(PMC *value, PMC *dest)PMC *bitwise_lsr_int(INTVAL value, PMC *dest)
Returns in void i_bitwise_lsr(PMC *value)void i_bitwise_lsr_int(INTVAL value)
Inplace shift right.
PMC *bitwise_shl(PMC *value, PMC *dest)PMC *bitwise_shl_int(INTVAL value, PMC *dest)
Returns in void i_bitwise_shl(PMC *value)void i_bitwise_shl_int(INTVAL value)
Inplace shift left.
A negative
*dest the bitwise OR of the scalar and value.
*dest the bitwise AND of the scalar and value.
*dest the bitwise XOR of the scalar and *value.
*dest the bitwise negation of the scalar and value.
*dest the arithmetic shift right of the scalar by value.
A negative value shifts left.
The destination may become a BigInt as a result (but only if the shift amount is less than zero).
value shifts left.
SELF may become a BigInt as a result (but only if the shift amount is less than zero).
*dest the logical shift right of the scalar by *value.
*dest the shift left of the scalar by *value.
A negative value shifts right.
The destination may become a BigInt as a result.
value shifts right.
SELF may become a BigInt as a result.String Methods
PMC *concatenate(PMC *value, PMC *dest)PMC *concatenate_str(STRING *value, PMC *dest)
Returns in void concatenate(PMC *value)void concatenate_str(STRING *value)
Concatenate the string PMC *repeat(PMC *value, PMC *dest)PMC *repeat_int(INTVAL value, PMC *dest)
Returns in void i_repeat(PMC *value)void i_repeat_int(INTVAL value)
Repeat the string
*dest the result of concatenating the scalar and *value.
value in place.
*dest the result of repeating the scalar value times.
SELF in place value times.Compare Methods
INTVAL cmp_num(PMC *value)
Returns the result of comparing the floating-point values of the scalar and INTVAL cmp_string(PMC *value)
Returns the result of comparing the string values of the scalar and INTVAL is_equal(PMC *value)
Returns whether the PMC is equal to INTVAL is_equal_num(PMC *value)
Returns whether the PMC is numerically equal to INTVAL is_equal_string(PMC *value)
Returns whether the PMC has string equality with
*value.
*value.
*value.
*value.
*value.Logical Methods
PMC *logical_or(PMC *value, PMC *dest)
Returns the result of the logical PMC *logical_and(PMC *value, PMC *dest)
Returns the result of the logical PMC *logical_xor(PMC *value, PMC *dest)
Returns the result of the logical PMC *logical_not(PMC *dest)void i_logical_not()
Returns in INTVAL defined()
Always returns true.
STRING *substr_str(INTVAL offset, INTVAL length)
Returns the substring of length void share_ro()
Sets this PMC as shared and read-only.
OR of SELF and value,
i.e.
returns SELF it is true or value: dest is alway ignored.
AND of SELF and value,
i.e.
returns value if SELF is true else SELF.
dest is always ignored.
XOR of SELF and *value.
*dest the result of the logical negation of the scalar and *value.
length of the scalar starting at offset.