Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^2: random number with range

by Anonymous Monk
on Apr 04, 2020 at 19:28 UTC ( [id://11115055]=note: print w/replies, xml ) Need Help??


in reply to Re: random number with range
in thread random number with range

ok, that works , but why you add +1 in the end? i see that without it, the generator does not generate full lenght( te top number never apiers) but with +1 its all right, where does the 1 goes that we need manually add it?

Replies are listed 'Best First'.
Re^3: random number with range
by Your Mother (Archbishop) on Apr 05, 2020 at 02:39 UTC

    This might explain; rand(1) can never produce 1 for example, so–

    perl -E 'say int 0.999999999' 0

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (7)
As of 2024-04-23 18:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found