From: Szabolcs Nagy Date: Sat, 8 Jun 2013 13:31:10 +0000 (+0000) Subject: prng: fix rand() to give good sequence with small state X-Git-Url: http://nsz.repo.hu/git/?p=musl;a=commitdiff_plain;h=c79cd27e9e81eb5e223728094f1233ee2fc12dda;hp=c79cd27e9e81eb5e223728094f1233ee2fc12dda;ds=sidebyside prng: fix rand() to give good sequence with small state 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 ---