NAME ^

classes/pyint.pmc - Python Integer

DESCRIPTION ^

PyInt extends PyObject to provide a Python integer.

Methods ^

PMC *get_bignum()

Return a new PyLong PMC with the value of SELF.

PMC *clone()

Return a clone of the integer.

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

PMC *divide_int(INTVAL value, PMC *dest)

PMC *divide_float(FLOATVAL value, PMC *dest)

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

*/ PMC* divide (PMC* value, PMC* dest) { MMD_BigInt: { return SUPER(value, dest); } MMD_DEFAULT: { return SUPER(value, dest); } }

/*

PMC* "__hex__"(PMC *self)

Returns the hex representation of self.

PMC* "__oct__"(PMC *self)

Returns the octal representation of self.

PMC* "__pos__"(PMC *self)

Returns the value of the prefix operator +.

PMC* "__truediv__"(PMC *self, PMC *value)

Divides self by *value and returns the result.

INTVAL cmp(PMC *value)

Returns the result of comparing the integer with *value.

INTVAL get_bool()

Returns the boolean value of the integer.

PMC *get_class()

Return the class of this object.

INTVAL get_integer()

Returns the integer value of the integer.

FLOATVAL get_number()

Returns the float value of the integer.

STRING *get_string()

Returns the string value of the integer.

INTVAL hash()

Returns a unique hash for this value

PMC* "__new__"(PMC *class, PMC *source)

Create a new integer

INTVAL is_same(PMC *value)

Returns whether the PMC is numerically equal to value.

INTVAL is_equal (PMC *value)

The == operation.

void set_integer_native(INTVAL value)

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

void set_integer_same(PMC *value)

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

void set_pmc(PMC *value)

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


parrot