NAME Math::Random::MT - The Mersenne Twister PRNG SYNOPSIS use Math::Random::MT; $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. DESCRIPTION The Mersenne Twister is a pseudorandom number generator developed by Makoto Matsumoto and Takuji Nishimura. It is described in their paper at . This module implements two interfaces, as described in the synopsis above. It defines the following functions. Functions new($seed) Creates a new generator and seeds it appropriately. rand($num) Behaves exactly like Perl's builtin rand(), returning a number uniformly distributed in [0, $num) ($num defaults to 1). srand($seed) This is an alternative interface to the module's functionality. It behaves just like Perl's builtin srand(). If you use this interface, it is strongly recommended that you call srand() explicitly, rather than relying on rand() to call it the first time it is used. SEE ALSO Math::TrulyRandom ACKNOWLEDGEMENTS Sean M. Burke For giving me the idea to write this module. Philip Newton For several useful patches. AUTHOR Abhijit Menon-Sen Copyright 2001 Abhijit Menon-Sen. All rights reserved. This software is distributed under the terms of the Artistic License .