
qwertymaniac at gmail
May 25, 2008, 1:26 PM
Post #5 of 5
(38 views)
Permalink
|
Like what others said, use the Decimal class to avoid this. from decimal import Decimal x=Decimal(5) x/=2 x*=Decimal("11.4") print x # 28.50 On Mon, May 26, 2008 at 1:28 AM, <notnorwegian[at]yahoo.se> wrote: > >>> x = 5 > >>> x /= 2 > >>> x > 2 > >>> x *=11.4 > >>> x > 22.800000000000001 > > ok where does the 1 in the come from? > -- > http://mail.python.org/mailman/listinfo/python-list > -- Harsh J www.harshj.com
|