Linear congruential generator: Difference between revisions

Content added Content deleted
m (→‎{{header|F_Sharp|F#}}: 'congruential' => 'congruent')
m (seed_n => state_n)
Line 26: Line 26:


* <math>state_{n + 1} = 214013 \times state_n + 2531011 \pmod{2^{31}}</math>
* <math>state_{n + 1} = 214013 \times state_n + 2531011 \pmod{2^{31}}</math>
* <math>rand_n = seed_n \div 2^{16}</math>
* <math>rand_n = state_n \div 2^{16}</math>


The BSD formula was so awful that FreeBSD switched to a different formula. More info is at [[Random number generator (included)#C]].
The BSD formula was so awful that FreeBSD switched to a different formula. More info is at [[Random number generator (included)#C]].