On Sat, Sep 29, 2012 at 11:26 AM, Brett Cannon <br...@python.org> wrote: > > > On Sat, Sep 29, 2012 at 9:07 AM, Paul Moore <p.f.mo...@gmail.com> wrote: >> >> 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) > > > Does this mean we want to re-open the discussion about decimal constants? > Last time this came up I think we decided that we wanted to wait for > cdecimal (which is obviously here) and work out how to handle contexts, the > syntax, etc.
I think that ought to be a Python 4 feature if we ever want it to be a feature. And I'm not saying this to kill the discussion; I just think it will be a huge change that we have to consider very carefully. While the existing float definitely has problems for beginners, it is incredibly useful for advanced users. Consider e.g. the implications for numpy / scipy, one of the fastest-growing specialized Python user communities. Now if you want to introduce a new notation for decimals, e.g. 3.14d and 1e42d, that would be a fine thing. (Should we also have complex decimals? 1jd anyone?) -- --Guido van Rossum (python.org/~guido) _______________________________________________ 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