Dear Tutors,

Reading through Wesley's delightful Core Python Programming, I came across 
something I have not been able to grasp yet. Some introductory code:

>>> 1
1
>>> 1.1
1.1000000000000001
>>> print 1
1
>>> print 1.1

1.1


The second case is, of course, what is throwing me. By having a decimal point, 
"1.1" is a float type, and apparently it cannot be represented by binary 
floating point numbers accurately. I must admit that I do not understand why 
this is the case. Would anyone be able to enlighten me?

-Sam



_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to