hello, the corrected code which seems to be the simple (for my needs)
#!/usr/bin/perl use strict; use warnings; my $i; my @array; $array[0][0] = 0; $array[0][1] = 0; for $i ( 1..150 ) { $array[$i][0] = $i; $array[$i][1] = sprintf '%.6f', $array[$i-1][1] + 0.2; $array[$i][1] =~ s/\.*0*$//; print "$array[$i][0]\t$array[$i][1]\n"; } exit;
the regexp is here to remove the unecessary precision
thanks again for all yours answers
In reply to Re: precision problem ?
by Anonymous Monk
in thread precision problem ?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |