May 2019
Intermediate to advanced
698 pages
17h 21m
English
The LCG is one of the oldest ways of generating a pseudo-random number sequence. It follows a simple, recursive formula:

X denotes the random number (or, more precisely, the nth random number in the sequence). It is based on its predecessor multiplied by a factor, a, and offset by a constant, c. The modulo operator makes sure that there is no overflow. What's the first X? The seed! So a random number sequence will start with the seed, providing determinism if needed.
These parameter settings are subject to significant testing; in fact, many library and compiler developers have different settings. The Wikipedia page provides an overview ...
Read now
Unlock full access