看板 DFBSD_submit 關於我們 聯絡資訊
On Wed, May 12, 2004 at 06:11:21AM -0500, William M. Grim wrote: > I have included the patch, but to see what I mean about the current > rand(3) not being great, try this code (yes, I know, the seeding could > have been done better): > [snip] > cs = rand() % 2; [snip] In any good book about the rand() PRNG and in random(3) is a note that the lower bits have a very low entropy. E.g. chance the code to cs = (rand() >> 8) % 2; provides much better results. Joerg