Stefan Krah <ste...@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


_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to