NAME ^

pmc/luanumber.pmc - Lua Number

DESCRIPTION ^

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

Overloaded Methods ^

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".

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)

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 *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 *tonumber()

AUTHORS ^

Francois Perrad.

Klaas-Jan Stol.


parrot