Hello All, Right now I'm using Active Perl 5.10.1. I've been working with Perl for more than 10 years. Yet, today is the first time I notice this wierd thing. Maybe I ignore something about how Perl's math works, yet it's driving me crazy. I can't believe this is the first time I notice this and makes me wonder how many applications I've written in the past that are actually doing this without me knowing about it. I'm talking about this:
print 1.1 - 1; # Gives 0.1 print "\n"; print 2.1 - 2; # Gives 0.1 print "\n"; print 3.1 - 3; # Gives 0.1 print "\n"; print 4.1 - 4; # Gives 0.0999999999999996 ??? print "\n"; print 6.2 - 6; # Gives 0.2 print "\n"; print 7.2 - 7; # Gives 0.2 print "\n"; print 8.2 - 8; # Gives 0.199999999999999 ??? print "\n"; Why is this? Thanks in advance. Best regards, Francisco _______________________________________________ ActivePerl mailing list [email protected] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
