Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Lots of rand()s

by Jaap (Curate)
on Mar 08, 2004 at 12:46 UTC ( [id://334784]=note: print w/replies, xml ) Need Help??


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. :)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://334784]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2024-04-24 12:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found