Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: if condition only returns false . . .

by ton (Friar)
on Apr 05, 2001 at 04:15 UTC ( #69953=note: print w/ replies, xml ) Need Help??


in reply to if condition only returns false . . .

rand returns a floating point number between 0 and 1. The int operator takes the integer portion of that number, which will always be zero for numbers in the range [0, 1). Hence, always false!


Comment on Re: if condition only returns false . . .

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (13)
As of 2015-07-28 20:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (258 votes), past polls