Brian,
It's round-off error.
Try the following:
printf %0.1f Ghz\n, $speed;
Cheers,
Sui
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Brian Gibson
Sent: Sunday, May 23, 2004 3:49 PM
To: [EMAIL PROTECTED]
Subject: weird stuff in
Brian Gibson [EMAIL PROTECTED] wrote:
$starting_number = 1.0;
$ending_number = 20.1;
for ($speed = $starting_number; $speed $ending_number; $speed
= $speed + .1) {
print $speed Ghz\n;
} ## End of for 1.0 Ghz to the total possible speed of the
} ## processors.
That's how
* Brian Gibson [EMAIL PROTECTED] [2004:05:23:15:48:40-0400] scribed:
Can anyone explain why in this simple for loop it changes after it gets to
6.1? I am trying to create a pull down menu for a web page that lists
processor speeds from 1.0 Ghz all the way up to 20.0 Ghz and things get crazy