HP Forums
rounding, from another posting, a question... - Printable Version

+- HP Forums (https://archived.hpcalc.org/museumforum)
+-- Forum: HP Museum Forums (https://archived.hpcalc.org/museumforum/forum-1.html)
+--- Forum: Old HP Forum Archives (https://archived.hpcalc.org/museumforum/forum-2.html)
+--- Thread: rounding, from another posting, a question... (/thread-190456.html)



rounding, from another posting, a question... - Geoff Quickfall - 08-13-2011

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... - Paul Dale - 08-13-2011

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... - Marcus von Cube, Germany - 08-13-2011

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... - Walter B - 08-13-2011

Please see page 44 of the manual :-)


Re: rounding, from another posting, a question... - Paul Dale - 08-13-2011

Nicely written.

The default is round half even which isn't mentioned on page 44 :-)


- Pauli


Re: rounding, from another posting, a question... - Walter B - 08-13-2011

Thanks. Added - though it's for math geeks only as stated there ;-)


Re: rounding, from another posting, a question... - Paul Dale - 08-13-2011

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