Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 25 Feb 2001 21:37:44 +0300
From:      "Andrey A. Chernov" <ache@nagual.pp.ru>
To:        Mark Murray <mark@grondar.za>
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>
In-Reply-To: <200102251758.f1PHwuR02481@gratis.grondar.za>; from mark@grondar.za on Sun, Feb 25, 2001 at 07:59:41PM %2B0200
References:  <20010225193409.A56351@nagual.pp.ru> <200102251758.f1PHwuR02481@gratis.grondar.za>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010225213744.A57744>