How do I Block Events in wxPython

Stephen Hansen apt.shansen at gmail.com
Wed Dec 9 12:40:09 EST 2009


On Wed, Dec 9, 2009 at 9:06 AM, Wanderer <wanderer at 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20091209/77ec35da/attachment-0001.html>


More information about the Python-list mailing list