Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: random number with range

by salva (Abbot)
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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://553098]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2018-06-17 22:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?



    Results (107 votes). Check out past polls.

    Notices?