NAME

src/pmc/float.pmc - Floating-point number

DESCRIPTION

Float PMC extends the abstract Scalar PMC to provide floating-point number operations.

Functions

void init()
Initializes the number to zero.
PMC *clone()
Make an exact copy of this PMC.
void *get_pointer()
Return the memory address of an Float PMC. This is needed for certain NCI applications and may be disabled in certain security contexts.
FLOATVAL get_number()
Returns the value of the number.
INTVAL get_integer()
Returns an integer representation of the number by truncating (rounding toward zero).
INTVAL get_bool()
Evaluates the number as a boolean, i.e. it's true if it's not zero.
STRING *get_string()
Returns a Parrot string representation of the number.
STRING *get_repr()
void set_integer_native(INTVAL value)
void set_bool(INTVAL value)
void set_number_native(FLOATVAL value)
Sets the value of the number to value.
void set_string_native(STRING *value)
Sets the value of the number to the value of *value.Note that this method morphs the number into a String.
void set_pmc(PMC *value)
Sets the value of the number to the value in *value.
PMC *neg(PMC *dest)
void i_neg()
Set dest to the negated value of SELF.
INTVAL is_equal(PMC *value)
The == operation.
INTVAL cmp(PMC *value)
The cmp operation.
INTVAL cmp_num(PMC *value)
Returns the result of comparing the number with *value.
void increment()
Increments the number.
void decrement()
Decrements the number.
PMC *absolute(PMC *dest)
void i_absolute()
Sets dest to the absolute value of SELF.
void freeze(PMC *info)
Used to archive the number.
void thaw(PMC *info)
Used to unarchive the number.

Methods

METHOD PMC *acos()
Calculate and return the inverse cosine (a.k.a arccos) of the input argument.
METHOD PMC *acot()
Calculate and return the inverse cotangent (a.k.a. arccot) of the input argument.
METHOD PMC *asec()
Calculate and return the inverse secant (a.k.a. arcsec) of the input argument.
METHOD PMC *asin()
Calculate and return the inverse sine (a.k.a. arcsin) of the input argument.
METHOD PMC *atan()
Calculate and return the inverse tangent (a.k.a. arctan) of the input argument.
METHOD PMC *atan2()
Calculate and return the two argument inverse tangent (a.k.a. arctan) of the input argument.
METHOD PMC *cos()
Calculate and return the cosine of the input argument.
METHOD PMC *cosh()
Calculate and return the hyperbolic cosine of the input argument.
METHOD PMC *cot()
Calculate and return the cotangent of the input argument.
METHOD PMC *coth()
Calculate and return the hyperbolic cotangent of the input argument.
METHOD PMC *csc()
Calculate and return the cosecant of the input argument.
METHOD PMC *exp()
Calculate and return the exponential of the input argument.
METHOD PMC *ln()
Calculate and return the natural log (logarithm with base e) of the input argument.
METHOD PMC *log10()
Calculate and return the base 10 logarithm of the input argument.
METHOD PMC *log2()
Calculate and return the base 2 logarithm of the input argument.
METHOD PMC *sec()
Calculate and return the secant of the input argument.
METHOD PMC *sech()
Calculate and return the hyperbolic secant of the input argument.
METHOD PMC *sin()
Calculate and return the sine of the input argument.
METHOD PMC *sinh()
Calculate and return the hyperbolic sine of the input argument.
METHOD PMC *tan()
Calculate and return the tangent of the input argument.
METHOD PMC *tanh()
Calculate and return the hyperbolic tangent of the input argument.
METHOD PMC *sqrt()
Calculate and return the square root of the input argument.