Next: , Previous: , Up: random   [Index]


49.3 Simple random numbers

Constant: default-random-source

A randomness source built by make-random-source/mrg32k3a, making use of Pierre L’Ecuyer’s MRG32k3a generator. L’Ecuyer’s MRG32k3a generator.

Function: random-integer n

Use default-random-source to generate the next integer X in the range 0 <= X < U, where U is a positive integer. Subsequent results of this procedure are independent, uniformly distributed over the range 0 <= X < U.

Function: random-real

Use default-random-source to generate the next real number X in the range 0 < X < 1. X=0 and X=1 are excluded in order to allow \log(X) and \log(1-X) without the danger of a numerical exception. Subsequent results of this procedure are independent, uniformly distributed in the range 0 < X < 1.