in reply to Lots of rand()s

Here's an optimization:
$results{int(rand(10) + 1)}++;
There's no need to write it to $rand first. This should be a little bit faster.

What are you trying to prove with this? That rand() is not really random?

Replies are listed 'Best First'.
Re: Re: Lots of rand()s
by David Caughell (Monk) on Mar 09, 2004 at 21:00 UTC

    Hey Jaap,

    I'm not trying to prove anything. I just wanted to see what the results would be, and since I figured other people might want to also, I posted the results.

    Thanks for the optimization... makes a lot of sense. :)