rounding, from another posting, a question...


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...



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


This rounding on the 34S is not done for FIX display, only for rounding the intermediate results of the internal algorithms to register format.


Please see page 44 of the manual :-)


Nicely written.

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

- Pauli


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


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

Possibly Related Threads...
Thread Author Replies Views Last Post
  How to add image to HP Forum Posting Harold A Climer 2 557 11-20-2013, 02:28 PM
Last Post: Han
  HP Prime program: rounding to a fraction Patrice 3 576 10-31-2013, 06:16 AM
Last Post: Joe Horn
  Example of an App created for Prime, (schedule program from earlier posting). Geoff Quickfall 0 317 10-28-2013, 05:09 PM
Last Post: Geoff Quickfall
  HP Prime: Rounding error in determinant Stephan Matthys 3 588 10-25-2013, 09:29 PM
Last Post: Walter B
  Rounding of 10^x Olivier De Smet 8 920 08-28-2013, 06:33 AM
Last Post: Dieter
  Estimating Accumulated Rounding Errors Egan Ford 13 1,168 08-16-2012, 01:49 PM
Last Post: Egan Ford
  WP34s: number display and rounding Dieter 4 497 10-14-2011, 05:11 PM
Last Post: Marcus von Cube, Germany
  Further to an earlier posting, Method to the madness! Geoff Quickfall 6 617 03-16-2010, 09:38 PM
Last Post: Geoff Quickfall
  Rounding errors BruceH 4 585 11-22-2009, 11:24 AM
Last Post: Vieira, Luiz C. (Brazil)
  Rounding Revisited Rodger Rosenbaum 5 654 07-22-2009, 02:29 PM
Last Post: Rodger Rosenbaum

Forum Jump: