On Tue, 16 Dec 2003, pagoda wrote:
>
> for (my $value = -1; $value <= 1; $value += 0.1) {
>         print "$value\n";
> }

Hi,
I don't know if it might be helpful, but the following code works better:

for ($value = -1; $value <= 1; $value += 0.1) {
       printf ("%.1f\n",$value);
        }
This produces:
-1.0
-0.9
-0.8
-0.7
-0.6
-0.5
-0.4
-0.3
-0.2
-0.1
-0.0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1.0

Senthil



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to