delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/07/31/09:37:52

Message-Id: <199907311044.GAA17866@delorie.com>
From: "Dan Gold" <TedMat AT CoastNet DOT com>
To: <djgpp AT delorie DOT com>
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
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 <eliz AT is DOT elta DOT co DOT il>
> To: Adam Schrotenboer <ajschrotenboer AT lycosmail DOT com>
> 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?

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019