[Tutor] Python 2.5.4 - error in rounding

Lie Ryan lie.1296 at gmail.com
Fri May 21 14:14:51 CEST 2010


On 05/21/10 20:17, Neven Goršić wrote:
> Hi!
> 
> I run into Python error in rounding and not know how to predict when it will
> occur in order to prevent wrong result.

That's because it's floating point number.

> What can I do to assure accurate result?

Use decimal module to do precise control over your rounding.



More information about the Tutor mailing list