delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1998/11/17/07:55:39

From: Kbwms AT aol DOT com
Message-ID: <173b7616.365163e8@aol.com>
Date: Tue, 17 Nov 1998 06:54:16 EST
To: eliz AT is DOT elta DOT co DOT il
Cc: djgpp-workers AT delorie DOT com
Mime-Version: 1.0
Subject: Re: src/libc/ansi/stdlib/rand.c
X-Mailer: AOL 3.0 16-bit for Windows sub 38
Reply-To: djgpp-workers AT delorie DOT com

Subj:	 Re: src/libc/ansi/stdlib/rand.c
To:	eliz AT is DOT elta DOT co DOT il (Eli Zaretskii)
CC:	djgpp-workers AT delorie DOT com

Dear Eli Zaretskii,

On 11-17-98 at 04:07:29 EST you wrote:
>
> The rationale behind this requirement, as I understand it, is that
> once your application starts a random sequence, it should have total
> control on the produced sequence.  If some library function calls
> `rand', some of the generated random numbers will be ``stolen'' and
> won't be seen by the application.
>

Function `rand' is a full-period generator which means that it repeats
after its full complement of variates has been generated.  The period
of DJGPP `rand' is 2^64-1.  If one variate per microsecond could be
generated, the period would last beyond the year 3100, give or take a
millennium, starting now.

Further, the fact that the generator is cyclic means that the numbers
``stolen'' at the beginning of the sequence must eventually reappear.


K.B. Williams

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019