next up previous contents
Next: Tests on the Up: The generator and Previous: The generator and

The linear congruential generator

The linear congruential generator consists of the following four numbers :

from which a sequence of random numbers can be generated by setting

mod m

These numbers should be chosen in such a way, that the random number stream provides a long cycle time and has good statistical properties. The library combines three generators :

The random number then comes from the formula :

The implementation in the library (the generator::random method) rewrites these formulas to ensure compatibility of this method. This generator has a period of , which means that you won't get a cycle. Furthermore, it has passed several statistical tests.



A Eliens
Tue Oct 31 09:27:21 MET 1995