Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: random number with range

by salva (Monsignor)
on Jun 01, 2006 at 17:34 UTC ( #553098=note: print w/ replies, xml ) Need Help??


in reply to random number with range

my $num = $min + rand($max - $min);
or...
my $int = $min + int(rand($max - $min));
if you want integers.


Comment on Re: random number with range
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (12)
As of 2014-07-23 06:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (135 votes), past polls