Loading

SRANDPDF


math statistics
Since v2.2.1
Available on all platforms
See also

Pushes on the stack a function which emits values according to a provided value histogram.

The randomization is seeded. The seeded PRNG must have been initialized beforehand using PRNG.

The result is a function. This function does not have any arguments.

To use the function pushed by SRANDPDF onto the stack, use EVAL.

Signature

Examples

42 PRNG { 0 2 1 1 2 1 } SRANDPDF 'p' STORE $p EVAL $p EVAL $p EVAL $p EVAL