parrotcode: resizable array for floating point | |
Contents | PMCs |
src/pmc/resizablefloatarray.pmc - resizable array for floating point numbers only
This class,
ResizableFloatArray
,
implements an array of resizable size,
which stores FLOATVALs.
It uses Float PMCs to do all necessary conversions.
FLOATVAL get_number_keyed_int(INTVAL key)
key
.
void set_number_keyed_int(INTVAL key, FLOATVAL value)
key
to value
.
void set_integer_native(INTVAL size)
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).
PMC *clone()
void push_float(FLOATVAL value)
value
to the end of the array.
FLOATVAL pop_float()
INTVAL shift_float()
void unshift_float(FLOATVAL value)
docs/pdds/pdd17_basic_types.pod.
Initial version - Matt Fowles 2004-06-11 Changed allocator to double size - Matt Fowles 2004-06-15 moved available size to int_val2 - Matt Fowles 2005-07-22
|