Returns a pseudo-random number using the Mersenne Twister algorithm.
lispworks
mt-random arg &optional state => random-number
arg⇩ | |
state⇩ |
An object of type mt-random-state. The default is the value of *mt-random-state*. |
random-number⇩ |
A non-negative number less than arg and of the same type as arg. |
The function mt-random
returns a pseudo-random number which is non-negative, less than arg and is of the same type as arg.
state contains the state of the pseudo-random number generator and is updated.
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.
LispWorks® User Guide and Reference Manual - 01 Dec 2021 19:30:41