random_source_for_integers(rs)
random_source_for_reals(rs, @optional precision)
random_source_for_byte_arrays(rs)
Return a function for generating pseudo random exact integers, inexact reals or
byte arrays using the random source object rs
.
For random_source_for_reals
, the optional parameter precision
specifies an upper bound on the
minimum amount by which two generated pseudo-random numbers can be separated.
let rs = random_source()
let ri = random_source_for_integers(rs)
let rr = random_source_for_reals(rs)
let ra = random_source_for_byte_arrays(rs)
ri(10)
// ...a random integer..
rr()
// ...a random real...
ra(10)
// #u8[...array of 10 random bytes...]