NAME ^

pmc/luanumber.pmc - Lua Number

DESCRIPTION ^

LuaNumber extends LuaAny to provide a class with the behaviour of the Lua Number type.

Overloaded Methods ^

void init()

Initializes the number to zero.

PMC *new_from_string(STRING *rep, INTVAL flags)

Return a LuaNumber PMC created from a string (Implementation is based on new_from_string() from Integer PMC).

Allow :

    .const .LuaNumber n = "12.34"
STRING *name()

Return the string "number".

PMC *clone()

Creates and returns a clone of the scalar.

INTVAL get_integer()

Returns an integer representation of the number (by casting).

FLOATVAL get_number()

Returns the value of the number.

STRING *get_string()

Returns a Parrot string representation of the number.

void set_integer_native(INTVAL value)

void set_number_native(FLOATVAL value)

VOID set_string_native(STRING *value)

void set_pmc(PMC *value)

Sets the value of the number to the value in *value.

void increment()

Increments the number.

void decrement()

Decrements the number.

PMC *neg (PMC *dest)

void i_neg ()

non-Vtable Methods ^

PMC *add (PMC *value, PMC *dest)

void i_add (PMC *value)

PMC *subtract (PMC *value, PMC *dest)

void i_subtract (PMC *value)

PMC *multiply (PMC *value, PMC *dest)

void i_multiply (PMC *value)

PMC *divide (PMC *value, PMC *dest)

void i_divide (PMC *value)

PMC *modulus (PMC *value, PMC *dest)

void i_modulus (PMC *value)

PMC *pow (PMC *value, PMC *dest)

void i_pow (PMC *value)

INTVAL is_equal (PMC *value)

INTVAL cmp (PMC *value)

PMC *concatenate (PMC *value, PMC *dest)

void i_concatenate (PMC *value)

Specific Methods ^

PMC *rawequal (PMC *value)

PMC *tonumber()

AUTHORS ^

Francois Perrad.

Klaas-Jan Stol.


parrot