Path: chuka.playstation.co.uk!news From: "Tones" Newsgroups: scee.yaroze.programming.2d_graphics Subject: Randomizer problem Date: Fri, 11 Jun 1999 13:25:58 +0100 Organization: PlayStation Net Yaroze (SCEE) Lines: 22 Message-ID: <7jqv39$qtv7@chuka.playstation.co.uk> NNTP-Posting-Host: 193.82.133.223 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2014.211 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211 Hi, Probably not the correct newsgroup to go through, but as it seems to be one of the most frequented, so I figured I'd post here. Basically, I am having problems with the rand() function in C. Numerous manuals state that this routine returns a value between 0 and RAND_MAX. Not a problem in itself, but how do I set RAND_MAX ? For example, I would like to obtain a totally random value between 0-320. However, to do this I need to set the maximum value I would like. From my understanding of other languages, normally a rand fuction returns a value like 0.78283929 - which you would multipy by your maximum number to obtain a value between that range. How on earth do you do it in C ? Any help greatly appreciated, Cheers! Tones 8)