On Wed, Dec 9, 2009 at 9:06 AM, Wanderer <wande...@dialup4less.com> wrote:
> Found another strange bug (Strange to me, anyway). int(0.8 * 10.0) = > 7. Had to change the code to int(0.8 * 10.0 + 0.0001). > > http://effbot.org/pyfaq/why-are-floating-point-calculations-so-inaccurate.htm Floating point math is not precise; if you need precision, use the decimal module. Alternately, you can just be sure to round() your floats to whatever precision you need to consider significant after calculations. --S
-- http://mail.python.org/mailman/listinfo/python-list