All Manuals > LispWorks User Guide and Reference Manual > 40 The LISPWORKS Package

NextPrevUpTopContentsIndex

mt-random

Function
Summary

Returns a pseudo-random number using the Mersenne Twister algorithm.

Package

lispworks

Signature

mt-random arg &optional state => random-number

Arguments

arg

A positive integer or a positive float.

state

An object of type mt-random-state. The default is the value of *mt-random-state*.

Values

random-number

A non-negative number less than arg and of the same type as arg.

Description

The function mt-random returns a pseudo-random number which is non-negative, less than arg and is of the same type as arg.

random-number is generated using the Mersenne Twister algorithm published by Makoto Matsumoto and Takuji Nishimura at
http://www.math.keio.ac.jp/~matumoto/emt.html.

We thank the authors for making the algorithm freely available.

mt-random is analogous to cl:random.

See also

make-mt-random-state
*mt-random-state*


LispWorks User Guide and Reference Manual - 13 Feb 2015

NextPrevUpTopContentsIndex