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.
Seeds random number generation with default (fixed) values.
A1 = A2 = A3 = int()
Seeds random number generation with integer values.
Returns a random float uniformly distributed between 0.0
and 1.0
.
N = int()
Given an integer N >= 1
, uniform(N)
returns a
random integer uniformly distributed between 1
and
N
.
Uses the process dictionary variable random_seed
to
remember the current seed.
Before a process calls uniform/0
or uniform/1
for
the first time, it must call one of the seeding functions.