Hi all,

I'm having a problem that is ticking me off. (to put it lightly)
Why does decimal do this -- I thought that getcontext().prec was number of decimal places?


import decimal
decimal.getcontext().prec = 2
a = decimal.Decimal(2)
b = decimal.Decimal(3)
100*a/b
Decimal("67")
print 100*a/b
67


Why does it do this?
It's really, really, messing things up for me because results are not interpreted in my programs correctly.
Jacob


_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to