From: fabio AT joplin DOT colorado DOT edu (Fabio Somenzi) Subject: random/srandom (was Re: link problems) 1 May 1997 12:18:35 -0700 Approved: cygnus DOT gnu-win32 AT cygnus DOT com Distribution: cygnus Message-ID: <199705011518.JAA14223.cygnus.gnu-win32@joplin.colorado.edu> References: <199704302026 DOT NAA14207 AT cirdan DOT cygnus DOT com> Reply-To: Fabio AT Colorado DOT EDU Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Original-To: gnu-win32 AT cygnus DOT com In-Reply-To: <199704302026.NAA14207@cirdan.cygnus.com> X-Mailer: VM 6.29 under Emacs 19.33.1 Original-Sender: owner-gnu-win32 AT cygnus DOT com >>>>> "GN" == Geoffrey Noer writes: GN> James Paul Morgan wrote: >> As far as I can tell, the gnu-win32 does not have the random and >> srandom functions. It only has the rand and srand functions, >> which are not nearly as random. I have had problems with moving >> software from an AIX system to my Win95 system becuase of this. GN> [...] GN> You are correct. We have not implemented these yet as of the GN> upcoming beta 18 release. GN> If someone can point me to a Berkeley-licensed implementation of GN> them or write them and send me a copyright assignment form, I'll GN> add them... I'm currently away from my Win95 laptop, but I just want to point out that the botched rand function can be identified by looking at the least significant bit: It looks random for a good implementation, but it's a periodic 0-1 sequence for many rand's. On my Linux box at the office, rand and random are the same function and both are "good." Maybe the Linux code is a good starting point for inclusion in cygwin. On a related note, I've given up some time ago relying on system functions to generate random numbers. I use my own, which I derived from the algorithms in "Numerical Recipes in C." This is not to say that cygwin shouldn't provide a decent random/srandom pair. It's just that if you rely on the random number generator for more than an extemporary exercise, and you want reproducibility of results, you should seriously consider using your own random number generator. Fabio -- Fabio Somenzi | Phone: 303-492-3466 University of Colorado | Fax: 303-492-2758 ECE Dept. | Email: Fabio AT Colorado DOT EDU Boulder CO 80309-0425 | WWW: http://vlsi.colorado.edu/~fabio - For help on using this list (especially unsubscribing), send a message to "gnu-win32-request AT cygnus DOT com" with one line of text: "help".