Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!usc!bbn!bbn.com!cosell From: cosell@bbn.com (Bernie Cosell) Newsgroups: comp.sys.amiga.tech Subject: Re: ARexx psuedo-random number generator Keywords: ARexx Random Number Generator Message-ID: <45512@bbn.COM> Date: 12 Sep 89 19:42:36 GMT References: <19504@unix.cis.pitt.edu> Sender: news@bbn.COM Reply-To: cosell@BBN.COM (Bernie Cosell) Organization: Bolt Beranek and Newman Inc., Cambridge MA Lines: 37 In article <19504@unix.cis.pitt.edu> ejkst@unix.cis.pitt.edu (Eric J. Kennedy) writes: } }I was having a little trouble with ARexx's random number generator, so I }performed the following small test. The 1 to 45 range is the range in my }application, so I kept it for the test. I'm using the time in seconds as the }seed, which strikes me as being the most variable easily obtainable number. } }All the program does is calculate 10000 pseudo-random numbers, and do a }histogram of sorts. } }This is using ARexx 1.10. } }/****************************************/ }/* test ARexx's random number generator */ } } }r=time('S') } }do index=1 to 10000 } r=random(1,45,r) } hist.r = hist.r + 1 }end Does this work? It strikes me that you'll surely get fairly odd behavior by resetting the random number seed EVERY time to the same value. I'm a little amazed that you got ANY different values out of the thing! I initialize the random generator by just doing: randu(time('S')) ONCE in my program [a talmud-like careful reading of the random number routines description lead me to believe that there is only ONE random number generator, and so seed'ing the 'randu' one will do for 'random'. I'll try your little test at home tonight with your seed-setup replaced with it done the way I usually do it and see whether that affects the results. /Bernie\