[issue13060] allow other rounding modes in round()

2012-05-24 Thread Arne Babenhauserheide
Arne Babenhauserheide added the comment: I also think that rounding half away from zero would be the most obvious choice, as it does not introduce a bias for random numbers distributed around 0 while being close to what I would expect from school mathematics. The case of n*(random() - 0.5) wh

[issue13060] allow other rounding modes in round()

2011-10-08 Thread Mark Dickinson
Mark Dickinson added the comment: I'm warming to this idea. We already have several round-to-integer functions (but not round-to-an-arbitrary-number-of-decimal-places) available in the math module (under the names floor, ceil and trunc). This *does* seem to be a common need, and it's easy t

[issue13060] allow other rounding modes in round()

2011-10-07 Thread Aaron Robson
Aaron Robson added the comment: When i run into I have to bodge around it in ways like the below code. I've only ever used round half up, has anyone here even used Bankers Rounding by choice before? For reference here are the other options: http://en.wikipedia.org/wiki/Rounding#Tie-breaking

[issue13060] allow other rounding modes in round()

2011-09-29 Thread Arne Babenhauserheide
Arne Babenhauserheide added the comment: cdecimal sounds great! when is it scheduled for inclusion? -- ___ Python tracker ___ ___ Pyt

[issue13060] allow other rounding modes in round()

2011-09-29 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue13060] allow other rounding modes in round()

2011-09-29 Thread Stefan Krah
Stefan Krah 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? It is finished and awaiting review (See #7652). The version

[issue13060] allow other rounding modes in round()

2011-09-29 Thread Mark Dickinson
Mark Dickinson added the comment: > maybe there should be a warning in the 2.7 documentation Well, such a warning really belongs in the Python 3 documentation rather than the Python 2 documentation. (Or at least, AFAIK that's the convention that's been followed to date: the Python 2 docs do

[issue13060] allow other rounding modes in round()

2011-09-29 Thread Arne Babenhauserheide
Arne Babenhauserheide added the comment: I did not know about rounding to even, so maybe there should be a warning in the 2.7 documentation, that the behavior changed in python 3 (I just checked that: python2.7 is in line with the documentation). The first time I stumbled over these issues w