You could use 'sprintf' as part of the loop. Adds some time, but maintains your 3 digits of precision.
perl -e '$n=22.4; for(1..99) { $n = sprintf("%.3f", $n+0.001 ); } prin +t "Result: $n\n";'
Hint: Try to think of your numbers as '$n' or '$s' and not '$a'. You'll understand in the future.
Good Luck
"Well done is better than well said." - Benjamin Franklin
In reply to Re: limit of for loop!!
by flexvault
in thread limit of for loop!!
by sagar123
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |