Mail Archives: djgpp/1999/09/25/15:13:55
Hi Thomas Harte ,
On Sat, 25 Sep 1999 17:59:11 +0100,
<<Thomas Harte>> 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
===================================
- Raw text -