Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 25 Feb 2001 09:52:40 +0100
From:      Erik Trulsson <ertr1013@student.uu.se>
To:        cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG
Subject:   Re: cvs commit: ports/astro/xglobe/files patch-random
Message-ID:  <20010225095240.A77183@student.uu.se>
In-Reply-To: <20010224225935.A769@mollari.cthul.hu>; from kris@obsecurity.org on Sat, Feb 24, 2001 at 10:59:35PM -0800
References:  <Pine.BSF.4.21.0102251713590.5810-100000@besplex.bde.org> <200102250640.f1P6e0q11960@earth.backplane.com> <20010224225935.A769@mollari.cthul.hu>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Feb 24, 2001 at 10:59:35PM -0800, Kris Kennaway wrote:

> 
> Bruce's objection is on different grounds, and I'll think about how we
> can improve rand() without breaking the standards.  Actually, on that
> matter, I have the suspicion that the rand() implementation (i.e. the
> algorithm it uses) is standardized somewhere (one of the C
> standards?).  Bruce, can you confirm?
> 
> Kris

(I am not Bruce, but...)

No, the algorithm of rand() is not standardized in the C standard.

OTOH, there is an example of a portable implementation of rand() in the
C standard and FreeBSD uses the same algorithm (as does many other
implementations of rand()). This is probably what you were thinking of.

As long as rand() and srand() behaves as describe in the man-page for
rand(3) they confirm to the C standard. (Provided that RAND_MAX is at 
least 32767.)


-- 
<Insert your favourite quote here.>
Erik Trulsson
ertr1013@student.uu.se


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?20010225095240.A77183>