From owner-cvs-all Sun Feb 25 10:38:20 2001 Delivered-To: cvs-all@freebsd.org Received: from nagual.pp.ru (pobrecita.freebsd.ru [194.87.13.42]) by hub.freebsd.org (Postfix) with ESMTP id 682D637B4EC; Sun, 25 Feb 2001 10:38:04 -0800 (PST) (envelope-from ache@nagual.pp.ru) Received: (from ache@localhost) by nagual.pp.ru (8.11.2/8.11.2) id f1PIbjE57889; Sun, 25 Feb 2001 21:37:46 +0300 (MSK) (envelope-from ache) Date: Sun, 25 Feb 2001 21:37:44 +0300 From: "Andrey A. Chernov" To: Mark Murray Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: rand.c patch for review (was: Re: cvs commit: ports/astro/xglobe/files patch-random) Message-ID: <20010225213744.A57744@nagual.pp.ru> References: <20010225193409.A56351@nagual.pp.ru> <200102251758.f1PHwuR02481@gratis.grondar.za> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200102251758.f1PHwuR02481@gratis.grondar.za>; from mark@grondar.za on Sun, Feb 25, 2001 at 07:59:41PM +0200 Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Sun, Feb 25, 2001 at 19:59:41 +0200, Mark Murray wrote: > > Patch for review: > > Whats wrong with > > int > rand(void) > { > return((int)random()); > } > > ?? 1) Seed & State. Even if srand() is backed by srandom(), if called independently, they overwrite each other seeding state. initstate() etc. adds more here. 2) Speed. -- Andrey A. Chernov http://ache.pp.ru/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message