From owner-freebsd-current Sun Feb 2 11:41:31 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 BCB0837B434 for ; Sun, 2 Feb 2003 11:41:29 -0800 (PST) Received: from a.smtp.serv.lythe.org.uk (pc4-oxfd1-6-cust225.oxfd.cable.ntl.com [62.254.141.225]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2CAB543F43 for ; Sun, 2 Feb 2003 11:41:24 -0800 (PST) (envelope-from ejb@lythe.org.uk) Received: from there (fisk.lythe.org.uk [192.168.1.180]) by a.smtp.serv.lythe.org.uk (8.12.6/8.12.6) with SMTP id h12JfJ1a004169; Sun, 2 Feb 2003 19:41:19 GMT (envelope-from ejb@lythe.org.uk) Message-Id: <200302021941.h12JfJ1a004169@a.smtp.serv.lythe.org.uk> Content-Type: text/plain; charset="iso-8859-1" From: Edward Brocklesby To: Bakul Shah Subject: Re: rand() is broken Date: Sun, 2 Feb 2003 19:41:17 +0000 X-Mailer: KMail [version 1.3.2] Cc: current@FreeBSD.ORG References: <200302021848.NAA19508@agamemnon.cnchost.com> In-Reply-To: <200302021848.NAA19508@agamemnon.cnchost.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Sunday 02 February 2003 6:48 pm, Bakul Shah wrote: > Guys, please realize that random() is also used in generating > simulation inputs (or timing or whatever). If you go change > the underlying algorithm or its parameters one can't generate > the same sequence from the same seed when repeating a test. Maybe I missed something, but why cannot you just rip random() from libc, rename it to bakul_shah_random() and use that in your testing code? Then you are safe from any changes to random(), and indeed have a portable RNG if your host OS changes. Regards, Edward. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message