From owner-freebsd-hackers Tue Feb 18 16: 9: 1 2003 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C4A2E37B405 for ; Tue, 18 Feb 2003 16:08:59 -0800 (PST) Received: from mail.deltanet.com (mail.deltanet.com [216.237.144.132]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0CE0943F3F for ; Tue, 18 Feb 2003 16:08:43 -0800 (PST) (envelope-from pherman@frenchfries.net) Received: from mammoth.eat.frenchfries.net (da001d0155.lax-ca.osd.concentric.net [66.239.48.155]) by mail.deltanet.com (8.11.6/8.11.6) with ESMTP id h1J08eQ19832 for ; Tue, 18 Feb 2003 16:08:41 -0800 Received: by mammoth.eat.frenchfries.net (Postfix, from userid 1000) id 2C55B4AFD; Tue, 18 Feb 2003 16:04:58 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by mammoth.eat.frenchfries.net (Postfix) with ESMTP id 138F04AC9 for ; Tue, 18 Feb 2003 16:04:58 -0800 (PST) Date: Tue, 18 Feb 2003 16:04:57 -0800 (PST) From: Paul Herman X-X-Sender: pherman@mammoth.eat.frenchfries.net To: FreeBSD Hackers Subject: arc4random() range Message-ID: <20030218153651.A240-100000@mammoth.eat.frenchfries.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hi, ...a potential quick commit for someone. :-) What's the concesus that arc4random() should be a drop-in replacement for rand()/random()? Consider the following that caclulates the average of a bunch of random numbers on [0.0, 1.0]: bash$ cat rand.c #include int i; double avg; #define ITERATIONS 1000000 #define FIND_AVG(func) do { \ for (i=0, avg = 0.0; i