Mail Archives: djgpp-workers/1998/11/17/07:55:39
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 -