From: mrh99 AT uswest DOT net (Matthew Haley) Newsgroups: comp.os.msdos.djgpp Subject: Re: srand() Organization: Home Message-ID: <37ed0d41.887291@news.uswest.net> References: <7shlcr$bn2$1 AT canopus DOT cc DOT umanitoba DOT ca> <37ec69fb DOT 17055060 AT news DOT uswest DOT net> <37ECFF5F DOT AAD52476 AT btinternet DOT com> X-Newsreader: Forte Free Agent 1.11/32.235 Lines: 27 Date: Sat, 25 Sep 1999 18:00:58 GMT NNTP-Posting-Host: 209.181.132.193 X-Trace: news.uswest.net 938282286 209.181.132.193 (Sat, 25 Sep 1999 12:58:06 CDT) NNTP-Posting-Date: Sat, 25 Sep 1999 12:58:06 CDT To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Hi Thomas Harte , On Sat, 25 Sep 1999 17:59:11 +0100, <> wrote: >> As an aside, I built this program with lcc-Win32 (I don't have DJGPP >> installed right now :), then ran it 645 times and it actually produced >> numbers between ~28,000 and ~30,000 so it's not the best way to get >> random numbers, unless you modify the result with a bit more math. > > You do realise that 'time' only returns the time accurate to the second, and >so, if your 645 runs were consecutive, this wasn't a very good test? > > -Thomas That would explain the non randomness. All I did was right a small program that called system("srand_demo >>output.txt") repeatedly. I supposes that putting the loop in the srand_demo.c and calling srand(time(NULL)) once at the beginning would have produced more random numbers. BTW, thanks for the info, it was late. =================================== Matthew Haley mrh99 AT uswest DOT net http://www.users.uswest.net/~mrh99 ===================================