www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/03/09/10:23:57

Date: Thu, 9 Mar 2000 14:28:25 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Ben Davis <ben AT vjpoole DOT freeserve DOT co DOT uk>
cc: djgpp AT delorie DOT com
Subject: Re: Random Numbers
In-Reply-To: <8a6fpg$gjg$1@news8.svr.pol.co.uk>
Message-ID: <Pine.SUN.3.91.1000309142808.1851J-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: dj-admin AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Wed, 8 Mar 2000, Ben Davis wrote:

> I know what random() and srandom() are. But what are initstate() and
> setstate()? The help files are very unspecific.

There's nothing to say about `setstate' except what the docs says.
Its argument is typically a value returned by a previous call to
`initstate'.

As for `initstate', it is impossible to explain it without describing
the theory behind the random number generator used by `random' and its
specific implementation.  (If somebody has enough time and motivation
to write that up, please send it for inclusion in a future release of
DJGPP.)

If you already know how `random's innards work, and you have specific
questions about `initstate', please ask those specific questions.
Otherwise, I suggest to take a good look at the sources of `random' in
the djlsr203.zip archive.

- Raw text -


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