Subject: Re: CVS commit: src/lib/libc/gen
To: Jun-ichiro itojun Hagino <itojun@netbsd.org>
From: David Laight <david@l8s.co.uk>
List: source-changes
Date: 09/14/2003 09:47:59
On Sat, Sep 13, 2003 at 09:29:58PM +0000, Jun-ichiro itojun Hagino wrote:
> 
> Module Name:	src
> Committed By:	itojun
> Date:		Sat Sep 13 21:29:58 UTC 2003
> 
> Modified Files:
> 	src/lib/libc/gen: randomid.c
> 
> Log Message:
> correct setup of ru_b and ru_a (for 32/20 bit case)

I don't think you have fixed two of the problems:

The LCG fails because:
	p->ru_a * p->ru_x + p->ru_b
exceeeds 2^32 during the multiply in the 20/32bit cases (even with ru_b small).

seed2 has to be killed because:
	p->ru_seed2 ^ p->ru_x
doesn't give a unique set of numbers modulo ru_n.

	David

-- 
David Laight: david@l8s.co.uk