I am facing a silly error. here is a simple script but its not working beyond for (1..42) that is for (1..43) or more.
$a = 22.400; for (1..43) { $a = $a + 0.001; } print "$a\n";
it should give me 22.443, but I am getting 22.4430000000001. It works fine if I use for (1..42) or less than 42 then I get correct value e.g. for (1..42) I get 22.442 So is there limit to run loop? but I never faced such problem before as I run loop many times.
In reply to limit of for loop!! by sagar123
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |