Mail Archives: djgpp/1999/07/31/09:37:52
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 -