Math::Random::MT - The Mersenne Twister PRNG |
Math::Random::MT - The Mersenne Twister PRNG
use Math::Random::MT;
$gen = Math::Random::MT->new($seed); # OR... $gen = Math::Random::MT->new(@seed);
print $gen->rand(3);
OR
use Math::Random::MT qw(srand rand);
# now srand and rand behave as usual.
The Mersenne Twister is a pseudorandom number generator developed by Makoto Matsumoto and Takuji Nishimura. It is described in their paper at <URL:http://www.math.keio.ac.jp/~nisimura/random/doc/mt.ps>.
This module implements two interfaces, as described in the synopsis above. It defines the following functions.
new($seed)
new(@seed)
rand($num)
srand($seed)
<URL:http://www.math.keio.ac.jp/~matumoto/emt.html>
Math::TrulyRandom
Abhijit Menon-Sen <ams@wiw.org>
Copyright 2001 Abhijit Menon-Sen. All rights reserved.
This software is distributed under the terms of the Artistic License <URL:http://ams.wiw.org/code/artistic.txt>.
Math::Random::MT - The Mersenne Twister PRNG |