Random number generator. The method is attributed to B.A. Wichmann and I.D.Hill, in 'An efficient and portable pseudo-random number generator', Journal of Applied Statistics. AS183. 1982. Also Byte March 1987.
The current algorithm is a modification of the version attributed to Richard A O'Keefe in the standard Prolog library.
seed() -> ran()
Seeds random number generation with default (fixed) values.
seed(A1, A2, A3) -> ran()
A1 = A2 = A3 = int()
Seeds random number generation with integer values.
uniform() -> float()
Returns a random float uniformly distributed between
uniform(N) -> int()
N = int()
Given an integer
N >= 1,
uniform(N) returns a
random integer uniformly distributed between
Uses the process dictionary variable
remember the current seed.
Before a process calls
the first time, it must call one of the seeding functions.