Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^4: inclusive rand

by pryrt (Abbot)
on Mar 13, 2017 at 15:28 UTC ( [id://1184429]=note: print w/replies, xml ) Need Help??


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

Since irand($n) returns [0,$n) => [0,$n-1] -- ie, not including $n -- you would have to divide by 524287 to get [0,1] inclusive.

Replies are listed 'Best First'.
Re^5: inclusive rand
by marioroy (Prior) on Mar 13, 2017 at 17:36 UTC

    Thank you, pryrt. I applied the correction.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (4)
As of 2024-04-19 04:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found