in reply to When is a 2 not a 2?
Gives:my $x; for ($x=1; int($x) <= 2; $x += 0.1) { print "$x\n"; } print "Stop: x=$x\n"; print "No, x is not 2.\n" if $x != 2;
So then I RTFM on int.1 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9 Stop: x=3 No, x is not 2.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: When is a 2 not a 2?
by ikegami (Patriarch) on Jan 31, 2008 at 10:24 UTC |