Re: Decimal ROUND_HALF_EVEN Default

2006-01-17 Thread Bengt Richter
On 16 Jan 2006 20:36:12 -0800, "Raymond Hettinger" <[EMAIL PROTECTED]> wrote: >LordLaraby wrote: >> If 'bankers rounding' is HALF_ROUND_EVEN, what is HALF_ROUND_UP? I >> confess to never having heard the terms. > >The terms are defined in the docs for the Context object: >http://docs.python.or

Re: Decimal ROUND_HALF_EVEN Default

2006-01-17 Thread 3c273
Thanks to all! Interesting reading. Louis -- http://mail.python.org/mailman/listinfo/python-list

Re: Decimal ROUND_HALF_EVEN Default

2006-01-17 Thread Rocco Moretti
LordLaraby wrote: > If 'bankers rounding' is HALF_ROUND_EVEN, what is HALF_ROUND_UP? I > confess to never having heard the terms. There was a Slashdot article on rounding a short while back: http://developers.slashdot.org/article.pl?sid=06/01/05/1838214 -- http://mail.python.org/mailman/listinfo

Re: Decimal ROUND_HALF_EVEN Default

2006-01-17 Thread Tim Peters
[LordLaraby] > If 'bankers rounding' is HALF_ROUND_EVEN, what is HALF_ROUND_UP? Not banker's rounding ;-). Same answer if you had said ROUND_HALF_UP instead (which I assume you intended) -- most of these don't have cute names. > I confess to never having heard the terms. ROUND_HALF_UP etc are

Re: Decimal ROUND_HALF_EVEN Default

2006-01-16 Thread Raymond Hettinger
LordLaraby wrote: > If 'bankers rounding' is HALF_ROUND_EVEN, what is HALF_ROUND_UP? I > confess to never having heard the terms. The terms are defined in the docs for the Context object: http://docs.python.org/lib/decimal-decimal.html The rounding option is one of: --

Re: Decimal ROUND_HALF_EVEN Default

2006-01-16 Thread Steven D'Aprano
LordLaraby wrote: > If 'bankers rounding' is HALF_ROUND_EVEN, what is HALF_ROUND_UP? I > confess to never having heard the terms. > I usually do: Y = int(X + 0.5) scaled to proper # of decimal places. > Which type of rounding is this? If either. Google Is Your Friend: http://www.diycalculator.c

Re: Decimal ROUND_HALF_EVEN Default

2006-01-16 Thread LordLaraby
If 'bankers rounding' is HALF_ROUND_EVEN, what is HALF_ROUND_UP? I confess to never having heard the terms. I usually do: Y = int(X + 0.5) scaled to proper # of decimal places. Which type of rounding is this? If either. -- http://mail.python.org/mailman/listinfo/python-list

Re: Decimal ROUND_HALF_EVEN Default

2006-01-16 Thread Tim Peters
[3c273] > I'm just curious as to why the default rounding in the decimal module is > ROUND_HALF_EVEN instead of ROUND_HALF_UP. Because it's the best (numerically "fairest") rounding method for most people most of the time. > All of the decimal arithmetic I do is rounded half up and I can't think

Re: Decimal ROUND_HALF_EVEN Default

2006-01-16 Thread Max Erickson
"3c273" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > Hello, > > I'm just curious as to why the default rounding in the decimal module > is ROUND_HALF_EVEN instead of ROUND_HALF_UP. All of the decimal > arithmetic I do is rounded half up and I can't think of why one might > use round hal