[Tutor] How did this decimal error pop up?

Dave Angel davea at davea.name
Wed Apr 17 01:02:45 CEST 2013


On 04/16/2013 06:10 PM, Hugo Arts wrote:
>
>    <SNIP>
> The other option, and probably the simplest to use, is python's built in
> decimal module, which provides a special class that implements perfectly
> accurate decimal calculations. Why don't we use it for all applications,
> you might ask? Well, it is extremely slow when compared to floats, and

I've been told (here) that starting with about Python 3.3, the decimal 
package is nearly as fast as float, for typical use.  The underlying 
processor logic is much slower, but it gets swamped by Python's overhead 
manipulating objects and searching dicts.

By nearly as fast, I'm thinking like 30%, rather than the previous 
1000%.  Or some such.

-- 
DaveA


More information about the Tutor mailing list