[issue13060] make round() floating-point errors less hurtful

2011-09-29 Thread Mark Dickinson
Mark Dickinson added the comment: Classifying this as a feature request: the behaviour of round isn't going to change here, but there might be community support for adding a mechanism for round to allow other rounding modes. It might be worth taking this to the python-ideas mailing list to

[issue13060] make round() floating-point errors less hurtful

2011-09-29 Thread Mark Dickinson
Changes by Mark Dickinson : -- type: -> feature request versions: +Python 3.3 -Python 3.2 ___ Python tracker ___ ___ Python-bugs-list

[issue13060] make round() floating-point errors less hurtful

2011-09-29 Thread Mark Dickinson
Mark Dickinson added the comment: > This is mathematically wrong ... No, it's not 'mathematically wrong'. There are many different rounding conventions in use, and no single universally agreed convention for rounding halfway cases. Python chooses to use unbiased rounding[1] here, which matc

[issue13060] make round() floating-point errors less hurtful

2011-09-29 Thread R. David Murray
R. David Murray added the comment: It seems to me that saying "floating point" and "mathematically correct" in the same breath is...optimistic :) But that's why I added Mark to nosy, he knows far more about this stuff than I do. As far as I know the accelerator is feature complete at this po

[issue13060] make round() floating-point errors less hurtful

2011-09-29 Thread Arne Babenhauserheide
Arne Babenhauserheide added the comment: If the C accelerator for decimal gets decimal performance close to floats (which I doubt, because it has to do much more), it could be very useful for me. What is its estimated time to completion? Even when it is finished, it does not change the proble

[issue13060] make round() floating-point errors less hurtful

2011-09-29 Thread Arne Babenhauserheide
Arne Babenhauserheide added the comment: Better comparision of decimal and float: >>> timeit("a+a", setup="from decimal import Decimal, getcontext; >>> getcontext().prec=17; a = Decimal(1.0)") 21.125790119171143 >>> timeit("a+a", setup="a = float(1.0)") 0.05324697494506836 -- __

[issue13060] make round() floating-point errors less hurtful

2011-09-29 Thread R. David Murray
R. David Murray added the comment: Note that a C accelerator for Decimal is in the works. -- nosy: +mark.dickinson, r.david.murray ___ Python tracker ___ ___

[issue13060] make round() floating-point errors less hurtful

2011-09-29 Thread Arne Babenhauserheide
New submission from Arne Babenhauserheide : Hi, I just stumbled over round() errors. I read the FAQ¹, and even though the FAQ states that this is no bug, its implementation is less than ideal. To illustrate: >>> round(0.5, 1) 0.0 and >>> round(5, -1) 0 This is mathematically wrong and