Decimal() instead of float?

Fredrik Lundh fredrik at pythonware.com
Fri Nov 17 17:36:32 EST 2006


Michael B. Trausch wrote:

> Sure, I do.  Let's say that I want to work with the latitude 
> 33.6907570.  In Python, that number can not be stored exactly without 
> the aid of decimal.Decimal().
> 
>  >>> 33.6907570
> 33.690756999999998
>  >>>
> 
> As you can see, it loses accuracy after the 6th decimal place.

You are joking, right?

</F>




More information about the Python-list mailing list