Random number generator

CCEL ccel at chance.uucp
Thu Dec 21 09:41:07 AEST 1989


Greetings 

I was trying to generate a random number bewteen 0 and maxlongint (i.e. 2^32)
on my machine (80386 with Interactive). The rand() function that I have
returns a psuedo-random number between 0 and MAXINT (which in this case
is 32768). I thought about generating two random numbers and multiplying
them together, but I realized that would produce a bell-curve-shaped
distrubution (the numbers in the middle would be more likely to occur).

Does anyone have any ideas or any code that generates random numbers,
or anyplace that I can check to find such code?

               Randy Tidd
rtidd at mwsun.mitre.org
Randy Tidd                   MITRE-McLean CCEL Lab
rtidd at mitre.arpa             ccel%community-chest at gateway.mitre.org
#define DISCLAIM TRUE



More information about the Comp.lang.c mailing list