Date: Thu, 9 Mar 2000 14:28:25 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Ben Davis cc: djgpp AT delorie DOT com Subject: Re: Random Numbers In-Reply-To: <8a6fpg$gjg$1@news8.svr.pol.co.uk> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 Precedence: bulk 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.