Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Random generator fail

by kcott (Chancellor)
on Dec 07, 2012 at 09:03 UTC ( #1007698=note: print w/replies, xml ) Need Help??


in reply to Random generator fail

Here's my $0.02 worth:

$ perl -E 'say 1 + int rand 99 for 1..3' 28 94 43

Obviously, change the 3 to 100.

Update: You appear to want decimals although you asked for a range using integers. Perhaps you could clarify.

This gives: 1.0 < random_number < 99.0

$ perl -E 'say 1 + rand 98 for 1..3' 38.6240726329874 72.0054041794683 94.0423383452302

-- Ken

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1007698]
help
Chatterbox?
[Eily]: LanX bless you!
[LanX]: why?
[Eily]: TSJAKKAA looks like a sneeze to me
[LanX]: oh thank you! :)
[Eily]: partly because I read tsj as /t͡ʃ/, don't know if that's supposed to be the case
[LanX]: Yeah I think thats Dutch spelling rule

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (11)
As of 2017-04-24 15:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (442 votes). Check out past polls.