Testing module

rng_below

procedureextensionsince 0.30.0Source

A number from 0 to count - 1; 0 when count is 0.

Example↗
rng := rng_seeded(1);
assert(rng_below(*rng, 6) < 6);
rng_below :: (rng: *Rng, count: u64) -> u64

A number from 0 to count - 1; 0 when count is 0.

Parameters

rng: *Rng
the generator to draw from.
count: u64
how many values to choose from.

Returns

u64
Example↗
rng := rng_seeded(1);
assert(rng_below(*rng, 6) < 6);

See also