NAME
src/pmc/resizablefloatarray.pmc - resizable array for floating point numbers only
DESCRIPTION
This class,
ResizableFloatArray
,
implements an array of resizable size,
which stores FLOATVALs.
It uses Float PMCs to do all necessary conversions.
Functions
FLOATVAL get_number_keyed_int(INTVAL key)
Returns the floating-point value of the element at index void set_number_keyed_int(INTVAL key, FLOATVAL value)
Sets the floating-point value of the element at index void set_integer_native(INTVAL size)
Resizes the array to PMC *clone()
Creates and returns a copy of the array.
void push_float(FLOATVAL value)
Adds FLOATVAL pop_float()
Removes and returns the last element in the array.
INTVAL shift_float()
Removes and returns an item from the start of the array.
void unshift_float(FLOATVAL value)
Add and integer to the start of the array.
key
.
key
to value
.
size
elements.When growing,
if the new size stays smaller than twice the old size,
grow to twice the old size; otherwise,
grow to the new size.When shrinking,
if the new size is smaller than half the old size,
shrink to one and half times the new size (which is less than or equal to three quarters of the old size).
value
to the end of the array.
SEE ALSO
docs/pdds/pdd17_basic_types.pod.