From owner-freebsd-current Sun Feb 2 12:48:22 2003 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6F76937B401 for ; Sun, 2 Feb 2003 12:48:21 -0800 (PST) Received: from nagual.pp.ru (pobrecita.freebsd.ru [194.87.13.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6475543E4A for ; Sun, 2 Feb 2003 12:48:20 -0800 (PST) (envelope-from ache@pobrecita.freebsd.ru) Received: from pobrecita.freebsd.ru (ache@localhost [127.0.0.1]) by nagual.pp.ru (8.12.6/8.12.6) with ESMTP id h12KmFd6067608; Sun, 2 Feb 2003 23:48:15 +0300 (MSK) (envelope-from ache@pobrecita.freebsd.ru) Received: (from ache@localhost) by pobrecita.freebsd.ru (8.12.6/8.12.6/Submit) id h12Km3O9067607; Sun, 2 Feb 2003 23:48:03 +0300 (MSK) (envelope-from ache) Date: Sun, 2 Feb 2003 23:48:03 +0300 From: "Andrey A. Chernov" To: Bakul Shah Cc: Edward Brocklesby , current@FreeBSD.ORG Subject: Re: rand() is broken Message-ID: <20030202204803.GA67572@nagual.pp.ru> References: <200302022018.h12KIC1a008066@a.smtp.serv.lythe.org.uk> <200302022039.PAA13951@warspite.cnchost.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200302022039.PAA13951@warspite.cnchost.com> User-Agent: Mutt/1.5.1i Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sun, Feb 02, 2003 at 12:39:50 -0800, Bakul Shah wrote: > > Note that it is rand() that is broken, not random() as can be > seen by modifying Kris Kennaways' test so I don't see why > Mark Murray was talking about changing it in the first place. About correlation bug: it is srand() which is broken, not rand(). It is common practice for this type of PRNGs to throw out N values after seeding to remove correlation and srand() not follow this. My first patch fix this. -- Andrey A. Chernov http://ache.pp.ru/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message