now, a stupid solution is: for (my $value = -1000; $value <= 1000; $value += 100) { print $value/1000, "\n"; }
hehe, ----- Original Message ----- From: "pagoda" <[EMAIL PROTECTED]> To: "begin begin" <[EMAIL PROTECTED]> Sent: Tuesday, December 16, 2003 1:54 PM Subject: Please help me! Thanks. > > for (my $value = -1; $value <= 1; $value += 0.1) { > print "$value\n"; > } > > The result is as following: > > -1 > -0.9 > -0.8 > -0.7 > -0.6 > -0.5 > -0.4 > -0.3 > -0.2 > -0.1 > -1.38777878078145e-16 > 0.0999999999999999 > 0.2 > 0.3 > 0.4 > 0.5 > 0.6 > 0.7 > 0.8 > 0.9 > 1 > > But what I wanted is: > > -1 > -0.9 > -0.8 > -0.7 > -0.6 > -0.5 > -0.4 > -0.3 > -0.2 > -0.1 > 0 > 0.1 > 0.2 > 0.3 > 0.4 > 0.5 > 0.6 > 0.7 > 0.8 > 0.9 > 1 > > > Help! please! > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > <http://learn.perl.org/> <http://learn.perl.org/first-response> > > > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>