Date: Mon, 1 Feb 1999 13:06:58 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Rehammar cc: djgpp AT delorie DOT com Subject: Re: random In-Reply-To: <36b4bcff.0@d2o25.telia.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com On Sun, 31 Jan 1999, Rehammar wrote: > a=range*(float)random()/(float)RAND_MAX; > > but I didn't likt the way of doing it, is there no other way ?? The other way is to say "random()%(range - 1)" (assuming `range' is an int), but that might yield less random results, as lower bits returned by RNGs are usually not-so-random. What's wrong with what you did in the first place, anyway?