farsi...@gmail.com wrote:
4 / 5.0
0.800000000000000004
0.8 * 5
4.0

Start here:
http://docs.python.org/tutorial/floatingpoint.html


Play with these:

>>> 4/5.0
0.800000000000000004
>>> print 4/5.0
0.8
>>> print repr(4/5.0)
0.800000000000000004
>>> str(4/5.0)
'0.8'
>>> repr(4/5.0)
'0.80000000000000004'


And learn more here:

http://www.lahey.com/float.htm

http://en.wikipedia.org/wiki/Floating-point


-tkc


--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to