parrotcode: Some utility functions | |
Contents | C |
src/utils.c - Some utility functions
Prototypes are in src/misc.h.
Opcode helper functions that don't really fit elsewhere.
intval_mod
x mod y = x - y * floor(x / y)
floatval_mod
n2 mod n3
.lcc
compiler.Based on the rand48()
family of functions.
next_rand
X
._erand48
double
in the interval [0.0, 1.0)
._drand48
double
in the interval [0.0, 1.0)
._jrand48
long
in the interval [-2^31, 2^31)
._nrand48
long
in the interval [0, 2^31)
._lrand48
long
in the interval [0, 2^31)
._mrand48
long
in the interval [-2^31, 2^31)
._srand48
seed
. The low order 16 bits are set to the arbitrary value 0x330e.Parrot_float_rand
FLOATVAL
in the interval [0.0, 1.0)
.how_random
is ignored.Parrot_uint_rand
INTVAL
in the interval [0, 2^31)
.how_random
is ignored.Parrot_int_rand
INTVAL
in the interval [-2^31, 2^31)
.how_random
is ignored.Parrot_range_rand
INTVAL
in the range [from, to]
.how_random
is ignored.Parrot_srand
seed
.Parrot_make_la
long
s with one more element than the number of elements in *array
. The elements are then copied from *array
to the new array, and the last (extra) element is set to 0.src/nci.c
.Parrot_destroy_la
Parrot_make_la()
.Parrot_make_cpa
char *
s with one more element than the number of elements in *array
. The elements are then copied from *array
to the new array, and the last (extra) element is set to 0.Parrot_destroy_cpa()
.Parrot_destroy_cpa
Parrot_make_cpa()
.tm_to_array
rec_climb_back_and_mark
node_index ... the index of a destination (i.e. with a pred.) register
c ... the graph and all the needed params : the context
process_cycle_without_exit
node_index ... the index of a destination (i.e. with a pred.) register
c ... the graph and all the needed params : the context
Initial version by leo 2003.09.09.
|