Linear congruential generator

Revision as of 21:12, 30 June 2011 by rosettacode>Kernigh (Part of a task. Trying to format some formulas.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

The linear congruential generator is a common and simple kind of random number generator. All linear congruential generators use this formula:

Linear congruential generator is a draft programming task. It is not yet considered ready to be promoted as a complete task, for reasons that should be found in its talk page.

Where:

  • is a seed.
  • , , , ..., are the random numbers.
  • , , are constants.

If one selects the values of , and with care, then the generator will yield uniform random numbers from to .

BSD formula

Microsoft formula

(Insert task here!)