in reply to precision problem ?
If you really need to do that, you might want to refactor your code to use integer maths by e.g. multiplying the numbers by 10 (if the smallest number you use is 0.1) and then dividing by 10 when you're done with the maths (and need to use the numbers).
my $i; my @array; for $i ( 0..150 ) { $array[$i][0] = $i; $array[$i][1] = $array[$i-1][1] + 2; printf "%s\t%s\n", $array[$i][0], $array[$i][1] / 10; }
|
|---|