[Python-Dev] [RELEASED] Python 3.3.0 release candidate 3

Stefan Krah stefan at bytereef.org
Sun Sep 30 09:25:48 CEST 2012

Stefan Krah <stefan at bytereef.org> wrote:
> Precision: 19 decimal digits
> float:
> result: 3.1415926535897927
> time: 0.112874s
> cdecimal:
> result: 3.141592653589793236
> time: 0.348100s
> decimal:
> result: 3.141592653589793236
> time: 43.241220s

Apparently there were concerns about the correctness of the result on some
message board. To be clear: This is a *benchmark* designed to execute the
same code for float, cdecimal and decimal.

The *original* algorithm from the decimal docs uses a higher intermediate
context precision. Since floats do not have such a context, this step was
deliberately dropped from the benchmark.

Stefan Krah

More information about the Python-Dev mailing list