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

Re^3: inclusive rand

by Eily (Monsignor)
on Mar 13, 2017 at 13:07 UTC ( [id://1184414]=note: print w/replies, xml ) Need Help??


in reply to Re^2: inclusive rand
in thread inclusive rand

Personally I'd make sure to stay below the precision of rand, to avoid skewing the probabilities because of the multiple operations (multiplication, rounding, division) and the error they may imply. Besides, there's nothing particularily significant about the precision of rand, it's probably around the best possible precision on a float. And you could actually get a better resolution than rand with Crypt::Random.

Replies are listed 'Best First'.
Re^4: inclusive rand
by msh210 (Monk) on Mar 13, 2017 at 13:09 UTC

    Thanks!

    $_="msh210";$"=$\;@_=@{[split//,uc]}[2,0];$_="@_$\1";$\=$/;++$_[0]for$...1;print lc substr crypt($_,"@_"),1,6

Log In?
Username:
Password:

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

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

    No recent polls found