Python doesn't know how to do math?

Chris Spencer clspence at one.net
Thu Apr 25 18:14:12 EDT 2002


	I tested this using the Python command interpreter on a Windows XP box
running:
Python 2.1 (#15, Apr 16 2001, 18:25:49) [MSC 32 bit (Intel)] on win32
Type "copyright", "credits" or "license" for more information.
>>> float(5)/float(100)
0.050000000000000003
>>> 5.0/100.0
0.050000000000000003

	Okay, I might not be a math genius, but this is most definately WRONG.
What gives?  Anyone have insight into this little "feature" of Python floating
point operations?

Chris.




More information about the Python-list mailing list