prng: fix rand() to give good sequence with small state
authorSzabolcs Nagy <nsz@port70.net>
Sat, 8 Jun 2013 13:31:10 +0000 (13:31 +0000)
committerSzabolcs Nagy <nsz@port70.net>
Sat, 8 Jun 2013 13:31:10 +0000 (13:31 +0000)
some applications rely on the low bits of rand() to be reasonably good
quality prng, so now it fixed by using the top bits of a 64 bit LCG,
this is simple, has small state and passes statistical tests.
D.E. Knuth attributes the multiplier to C.E. Haynes in TAOCP Vol2 3.3.4


No differences found