Re: Final fix for 0 problem (was Re: rand() is broken)

2003-02-03 Thread Mark Murray
Andrey A. Chernov writes: If I understand correctly, this still doesn't solve the problem, because any PRNG sequence that hits the magic value will still get stuck there forever. It was true for the first patch I post which just move problem to another= place (this is commonly spreaded

Re: Final fix for 0 problem (was Re: rand() is broken)

2003-02-03 Thread Andrey A. Chernov
On Mon, Feb 03, 2003 at 10:55:42 +, Mark Murray wrote: How do you _know_ that your newly chosen magic number isn't going to cause some kind of recurring (and too-short) sequence of numbers? I run simple test for it, it is not too short. -- Andrey A. Chernov http://ache.pp.ru/ To

Re: Final fix for 0 problem (was Re: rand() is broken)

2003-02-03 Thread Andrey A. Chernov
On Mon, Feb 03, 2003 at 14:08:41 +0300, Andrey A. Chernov wrote: On Mon, Feb 03, 2003 at 10:55:42 +, Mark Murray wrote: How do you _know_ that your newly chosen magic number isn't going to cause some kind of recurring (and too-short) sequence of numbers? I run simple test for it, it

Re: Final fix for 0 problem (was Re: rand() is broken)

2003-02-03 Thread Mark Murray
Andrey A. Chernov writes: On Mon, Feb 03, 2003 at 10:55:42 +, Mark Murray wrote: How do you _know_ that your newly chosen magic number isn't going to cause some kind of recurring (and too-short) sequence of numbers? I run simple test for it, it is not too short. simple test? How

Re: Final fix for 0 problem (was Re: rand() is broken)

2003-02-03 Thread Andrey A. Chernov
On Mon, Feb 03, 2003 at 11:19:17 +, Mark Murray wrote: simple test? How long did you check for? See my another message with details. random() is documented to not repeat before some number of outputs; how do you know that this fix does not significantly shorten that? random(3) is

Re: Final fix for 0 problem (was Re: rand() is broken)

2003-02-03 Thread Andrey A. Chernov
On Mon, Feb 03, 2003 at 14:26:00 +0300, Andrey A. Chernov wrote: random(3) is not affected to to its hashing nature. We talk about rand(3). to to = due to -- Andrey A. Chernov http://ache.pp.ru/ To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-current in the body of

Final fix for 0 problem (was Re: rand() is broken)

2003-02-02 Thread Andrey A. Chernov
So far, this is final variant for 0 problem fixing ready for committing. Any objections? --- stdlib/rand.c.old Sat Jan 4 20:39:19 2003 +++ stdlib/rand.c Sun Feb 2 17:34:34 2003 @@ -72,10 +72,13 @@ */ long hi, lo, x; + /* Can't be initialized with 0, so use another

Re: Final fix for 0 problem (was Re: rand() is broken)

2003-02-02 Thread Kris Kennaway
On Sun, Feb 02, 2003 at 06:10:49PM +0300, Andrey A. Chernov wrote: So far, this is final variant for 0 problem fixing ready for committing. Any objections? What tests have you run on this code to ensure it doesn't still have strange problems? Kris msg51583/pgp0.pgp Description: PGP

Re: Final fix for 0 problem (was Re: rand() is broken)

2003-02-02 Thread Doug Barton
On Sun, 2 Feb 2003, Andrey A. Chernov wrote: So far, this is final variant for 0 problem fixing ready for committing. Any objections? Several people, including myself have asked for A) Enough discussion to reach a consensus, and B) Thorough testing of the agreed upon solution. You have allowed

Re: Final fix for 0 problem (was Re: rand() is broken)

2003-02-02 Thread Andrey A. Chernov
On Sun, Feb 02, 2003 at 13:12:55 -0800, Doug Barton wrote: If I had to guess, I'd say that you're eager to fix the mistake you made, and I suppose that's commendable. However, it's been broken for two years, it can wait another couple days for a more thorough fix. If you talk about 0

Re: Final fix for 0 problem (was Re: rand() is broken)

2003-02-02 Thread Andrey A. Chernov
On Sun, Feb 02, 2003 at 13:06:08 -0800, Kris Kennaway wrote: On Sun, Feb 02, 2003 at 06:10:49PM +0300, Andrey A. Chernov wrote: So far, this is final variant for 0 problem fixing ready for committing. Any objections? What tests have you run on this code to ensure it doesn't still have

Re: Final fix for 0 problem (was Re: rand() is broken)

2003-02-02 Thread Kris Kennaway
On Mon, Feb 03, 2003 at 12:55:40AM +0300, Andrey A. Chernov wrote: On Sun, Feb 02, 2003 at 13:06:08 -0800, Kris Kennaway wrote: On Sun, Feb 02, 2003 at 06:10:49PM +0300, Andrey A. Chernov wrote: So far, this is final variant for 0 problem fixing ready for committing. Any objections?

Re: Final fix for 0 problem (was Re: rand() is broken)

2003-02-02 Thread Andrey A. Chernov
On Sun, Feb 02, 2003 at 14:21:02 -0800, Kris Kennaway wrote: If I understand correctly, this still doesn't solve the problem, because any PRNG sequence that hits the magic value will still get stuck there forever. It was true for the first patch I post which just move problem to another