Message-Id: <199907311044.GAA17866@delorie.com> From: "Dan Gold" To: Subject: Re: how about "more" random ? SPEED??? Date: Fri, 4 Jan 1980 06:27:54 -0800 X-MSMail-Priority: Normal X-Priority: 3 X-Mailer: Microsoft Internet Mail 4.70.1155 MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Reply-To: djgpp AT delorie DOT com I was wondering about how fast rand actually executes, Is it something to consider when using it alot or is it virtually unnoticable? Is there anyway to avoid the multiplications and mods? Is there a better alternative like making some kind of randomness look-up-table or something? from Dan Gold -=-=[CATACOMB ABYSS]=-=- http://www.geocities.com/SiliconValley/Port/1547/ ---------- > From: Eli Zaretskii > To: Adam Schrotenboer > Cc: djgpp AT delorie DOT com > Subject: Re: how about "more" random ? > Date: Thursday, July 29, 1999 10:11 PM > > > On Thu, 29 Jul 1999, Adam Schrotenboer wrote: > > > > x = ((double) rand ()) * 100 / RAND_MAX; > > > > Not exactly the correct method (IIRC), but close: > > > > x = ((double) rand ()/RAND_MAX) * 100; > > Care to explain what is the difference?