On 29 September 2012 10:17, Stefan Krah <ste...@bytereef.org> wrote: > Tim Delaney <timothy.c.dela...@gmail.com> wrote: >> If those numbers are similar in other benchmarks, would it be accurate and/or >> reasonable to include a statement along the lines of: >> >> "comparable to float performance - usually no more than 3x for calculations >> within the range of numbers covered by float" > > For numerical programs, 1.4x (9 digits) to 3x (19 digits) slower would be > accurate. On Windows the difference is even less. > > For output formatting, cdecimal is faster than float (at least it was when > I posted a benchmark a couple of months ago).
To me, this means that the key point is that for the casual user, float is no longer the "obvious" choice. You'd choose float for the convenience of a built in type, and Decimal for the more natural rounding and precision semantics. If you are sufficiently interested in performance for it to matter, you're no longer a "casual" user. (Up until now, I'd have said use float unless your need for the better behaviour justifies the performance loss - that's no longer the case). Paul. _______________________________________________ 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