ROUNDING???

Aahz aahz at pythoncraft.com
Mon Feb 18 22:36:42 EST 2008


In article <mailman.949.1203389866.9267.python-list at python.org>,
katie smith  <iceboy127 at yahoo.com> wrote:
>
>in python im doing the problem 255/494
>
>it keeps giving me 0 instead of .51....
>what am i doing wrong?

>>> from __future__ import division
>>> 2/5
0.40000000000000002

In addition:

>>> division
_Feature((2, 2, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 8192)

Therefore this works in Python 2.2 and higher.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"All problems in computer science can be solved by another level of     
indirection."  --Butler Lampson



More information about the Python-list mailing list