Message-ID: <392CB951.34B432E6@chemistry.uq.edu.au> Date: Thu, 25 May 2000 15:25:37 +1000 From: Chris Miller X-Mailer: Mozilla 4.72 [en] (Win95; U) X-Accept-Language: en MIME-Version: 1.0 To: djgpp AT delorie DOT com Subject: Random numbers Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Reply-To: djgpp AT delorie DOT com Hello, I have read what the function rand() is supposed to do, however it seems to produce a very different response on my computer from what I would expect. If RAND_MAX is set to 100, then a call to rand() should return an integer between 0 and 100. However, on my computer, a call to rand() generates a number between what appears to be hundreds of millions and 0, even with RAND_MAX set to 100. The computer I am using uses 4-byte integers (32-bit). Should I use short integers instead? Alternatively, do I need to separately recompile the library to include the changed RAND_MAX value rather than just place it at the top of my *.h file? Or is there another function that would be better to use, eg rand48? Ideally, I am attempting to generate a random integer between 0 and 1,000,000. Thank you in advance, Chris Miller