Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: for loop less than test ill behaved...

by haj (Vicar)
on Mar 30, 2020 at 15:37 UTC ( [id://11114810]=note: print w/replies, xml ) Need Help??


in reply to for loop less than test ill behaved...

The rand function returns a fractional number, but you just print the integer part with the %d format. In the last iteration $k is still less than $data_length which you'll see easily if you print using the %fformat, or just use print instead of printf.

  • Comment on Re: for loop less than test ill behaved...

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2024-04-26 03:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found