The Museum of HP Calculators

HP Forum Archive 20

 rounding, from another posting, a question...Message #1 Posted by geoff quickfall on 13 Aug 2011, 12:19 a.m. funny, but I was taught to round in a statistics course the following way. If the digit was even followed by a five then round up. If the digit followed by a five was odd, round down. Statistically this resulted, when using a large enough sample, a 50/50 ratio of rounding up for 5 and rounding down for five. ```132.5 = 133 133.5 = 133 ``` cannot find the cite for this anywhere. Calculators certainly do not follow this rule. This means, on a large enough sample the rounding is on majority, upwards, that is .5 is always rounded up even though it is a midway point between the higher and lower answer. Any thoughts, Cheers, Geoff still playing with the 41CL but will get involved with the 34S soon, well after the book and HCC... ;-)

 Re: rounding, from another posting, a question...Message #2 Posted by Paul Dale on 13 Aug 2011, 12:28 a.m.,in response to message #1 by geoff quickfall This is what is known as rounding half to odd. It is well known and unbiased as is ruonding half to even. The latter is more popular. These should only be used if the fractional portion is exactly 0.5. If e.g. it is 0.5001, then you should always round up. If you are only calculating the single extra digit then every 5 rounds weirdly of course. The 34S does rounding half even by default. It supports six other rounding modes but not rounding half to odd. - Pauli

 Re: rounding, from another posting, a question...Message #3 Posted by Marcus von Cube, Germany on 13 Aug 2011, 4:43 a.m.,in response to message #2 by Paul Dale This rounding on the 34S is not done for FIX display, only for rounding the intermediate results of the internal algorithms to register format.

 Re: rounding, from another posting, a question...Message #4 Posted by Walter B on 13 Aug 2011, 5:38 a.m.,in response to message #3 by Marcus von Cube, Germany Please see page 44 of the manual :-)

 Re: rounding, from another posting, a question...Message #5 Posted by Paul Dale on 13 Aug 2011, 5:51 a.m.,in response to message #4 by Walter B Nicely written. The default is round half even which isn't mentioned on page 44 :-) - Pauli

 Re: rounding, from another posting, a question...Message #6 Posted by Walter B on 13 Aug 2011, 5:56 a.m.,in response to message #5 by Paul Dale Thanks. Added - though it's for math geeks only as stated there ;-)

 Re: rounding, from another posting, a question...Message #7 Posted by Paul Dale on 13 Aug 2011, 6:08 a.m.,in response to message #6 by Walter B Nah, it is for people who care about getting correct answers :-) Most maths geeks wouldn't know what to do with the different rounding modes :-( Neither would most programmers numerical or otherwise :-( One quick way to detect many numerically unstable algorithms is to repeat the same computation after changing the rounding mode (e.g. start with round to -infinity and change to rount to +infinity). A stable algorithm will produce a similar result regardless and an unstable one will often produce wildly varying results. This doesn't catch all unstable algorithms but it is an easy starting point. - Pauli

Go back to the main exhibit hall