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.
In reply to Re: for loop less than test ill behaved...
by haj
in thread for loop less than test ill behaved...
by JCyow2020
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |