random_source_for_integers/reals/byte_arrays


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.

Examples:


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...]
      

Also see:

default_random_source
random_integer


Core Module Index | Contents