Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!cs.utexas.edu!husc6!spdcc!merk!alliant!linus!chance!ccel From: ccel@chance.uucp (CCEL) Newsgroups: comp.lang.c Subject: Random number generator Keywords: random maxint Message-ID: <83943@linus.UUCP> Date: 20 Dec 89 22:41:07 GMT Sender: news@linus.UUCP Reply-To: rtidd@mwsun.mitre.org Organization: MITRE-McLean Software Engineering Laboratory Lines: 17 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@mwsun.mitre.org Randy Tidd MITRE-McLean CCEL Lab rtidd@mitre.arpa ccel%community-chest@gateway.mitre.org #define DISCLAIM TRUE