One of the simplest, most widely used, and oldest (D.H. Lehmer, 1948)
random number generators is the (multiplicative) linear congruential
generator (MLCG or LCG).
The generator is specified by integer constants A, C and M,
and produces a sequence of random integers via
For real numbers in [0,1) can just use , so M should be
large (near
for 32-bit real numbers).
A, C and M must be carefully chosen in order to produce sequences that are random and have a long period. M is the maximum period for this type of generator, but it can be much less.