From: davidD AT qimr DOT edu DOT au (David Duffy) Newsgroups: comp.os.msdos.djgpp Subject: Re: a randomize function for DJGPP? Date: 13 Mar 1997 02:29:52 GMT Organization: Queensland Institute of Medical Research Message-ID: <5g7or0$sq0$1@nargun.cc.uq.edu.au> References: <5flbpp$m74 AT nr1 DOT ottawa DOT istar DOT net> <331FC0D1 DOT 1A26 AT cs DOT com> <5fps67$pc3 AT news DOT ox DOT ac DOT uk> Reply-To: davidD AT qimr DOT edu DOT au NNTP-Posting-Host: panther.qimr.edu.au Lines: 12 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp George Foot (gfoot AT mc31 DOT merton DOT ox DOT ac DOT uk) wrote: : Dave Cigna (cigna AT helios DOT phy DOT OhioU DOT Edu) wrote: : : The numbers will still not be uniformly distributed. Smaller values are : : more likely than large ones. To understand why, remember that random() : For the record, random() returns numbers from 0 to MAXINT, which is one : less than power of two. It also guarantees that *any* bit combination : you choose will return a uniformly random distribution; e.g. random()&5 : will give numbers from {0,1,4,5} with a uniform distribution. There is something to be said for using a portable RNG that produces the output that you want (I use the Wychman & Hill Appl Statist Algorithm 186 which is supposed to be fairly good -- run through f2c -- though I have recently downloaded "ranlux"). David Duffy.