I was generating some data for a little test project and used my old stand-by, perl. I found when I added .1 to 0 through 10, where I expect 6.0, the string output become "5.99999999999999". When I start at 5.9, the same fraction is missing when I get to 8.8: 8.79999999999998.
I tested this with Perl v5.12.3 that ships with Mac OS 10.7.5 as well as the version with the macports (v5.12.4). I'm on a 2.2 ghz i7 15" macbook pro.
for (my $i=0; $i<10; $i+=.1) {
print $i."\n";
}
Strangest thing I've seen since the old Pentium bug, and I can't seem to find any discussion on this. Am I missing something or is something wonky?