[Pythonmac-SIG] possible bug with division operator and floating point numbers

Timothy Sullivan tjsulli@hatch.sonalysts.com
Tue, 16 Jan 2001 21:51:54 -0500 (EST)


Hello All,
	I am just starting out learning python, and have only
just subscribed to this list when I found this "feature." I am going
through O'Reilly's Learning python and duitifully put in one of the
examples into the interactive prompt. it basically worked out to 4.0/5.0 .
which came back with the answer, "0.80000000000000004." Now I have been
out of school for a bit, but Ilearned that should be 0.8. I tried
different variations of the equation, and the same answer results. i tried
similar equations, 3.0/4, 1/2.0 and came up with the expected results. I
am using the 2.0 version of pythonmac from python.org. Am I being stupid
and this is expected, or perhaps there is an update to this problem I
could not find. Sorry if this has been covered previously, but any
thoughts would be appreciated.

Regards,
T.J. Sullivan