- or download this
# Loop over [0.00..1.00] by 0.05
for (my $i = 0; $i <= 100; $i += 5) {
my $x = $i / 100;
printf("[%d] x= %g (%20.40f)\n", ++$c, $x, $x);
}
- or download this
# Loop over [0.00..1.00] by 0.05
for (my $i = 0; $i <= 20; $i++) {
my $x = $i / 20;
printf("[%d] x= %g (%20.40f)\n", $i+1, $x, $x);
}
- or download this
# Loop over [0.00..1.00] by 0.05
for (0..20) {
my $x = $_ / 20;
printf("[%d] x= %g (%20.40f)\n", $_+1, $x, $x);
}
- or download this
[1] x= 0 (0.0000000000000000000000000000000000000000)
[2] x= 0.05 (0.0500000000000000030000000000000000000000)
...
[19] x= 0.9 (0.9000000000000000200000000000000000000000)
[20] x= 0.95 (0.9499999999999999600000000000000000000000)
[21] x= 1 (1.0000000000000000000000000000000000000000)