HP48g - Arithmetic Rounding querry


I am sure there is a reason for this explained somewhere in the manual, but I am hoping that someone knows the answer off the top of their head. As an example,why is it that I get the following - equating:
'5/3' (or 3, 'SPC', 5, /) = 1.66666666667 (which gives me '5/3' if i put it back as a fraction.

But if I do '5*(1/3)' (or 5,'SPC', 3, '1/x', x) = 1.66666666666 (which gives me '62500000003/37500000002' as a fraction; which is of course the exact solution of the 1.66...6 solution).

How do I prevent getting the second answer?(other than just by entering the equation in using the first method). Reason that I ask is that during exams I don't want to have to be always worrying about what format I should be entering the problem (so as to not get a large fraction as above.) I am supposing that there is a setting that I may need to change. Can anyone point me in the right direction here? Thanks


My 48 ran out of batteries but my 49 suggests that using ->QPi (where Pi is the greek letter) should help.

Or if you have a connection cable you should try: QPI from hpcalc.org


Edited: 7 Nov 2005, 9:04 a.m.


I would hazzard a guess that it is to do with the order that the expression is calculated.

5 * (1 / 3) = 5 * (0.333333333....) = 1.666666666666......5 and rounded 1.666666666666....6

5 / 3 = 1.666666666666666666666.........6 and rounded 1.6666666666666666...7

You can replicate this problem with any calculator.

Edited: 7 Nov 2005, 11:37 a.m.


That would have been my guess as well. But my 12C Platinum calculates 1.666666667 either way.


Yeah my Casio gives the me correct fraction regardless of how I enter it......

What confuses me again is this:
'2/3' = 0.666666666667 (which in turn gives me '2/3' as a fraction.

But if I do '2(1/3)' = 0.6666666666666 - this gives me '2/3' as a fraction.

Can anyone figure out the inconsistency from this and the initial problem I mentioned?

Edited: 7 Nov 2005, 3:48 p.m.


That would have been my guess as well. But my 12C Platinum calculates 1.666666667 either way.

It depends on the rounding. 0.33...333 * 5 is 1.66...665. This is one digit too much, so the final 5 has to be either truncated or rounded. ...665 is right between ...660 and ...670, and there are different methods in use. Half-up always rounds 5 up, and so the result is ...67. Half-even (sometimes called banker's rounding) rounds fives to the nearest even digit, which in this case is 6.

The advantage of half-even rounding is that it gives a better statistical distribution of errors, because 5 really is right between 0 and 10, and always rounding up isn't fair.


Hi, Gunnar:

This link features an interesting and worthwhile discussion on rounding, and includes simple code to implement most usual rounding strategies.

Best regards from V.


Thank you, It is very interesting.

I knew about the difference between VBA and Excel, but I was not aware that they had such a mess across their product line, and I had not noticed that Java had a homebrew not-seen-anywhere-else round() function.

Mike Cowlishaw's General Decimal Arithmetic Specification has a list of all the rounding modes you may need when things are actually designed, and not just happens.

This is a superset of the modes described in the IEEE 854 standard, and implemented in the HP 71B.

He has the following note:

The term ‘round to nearest’ is not used because it is ambiguous. round-half-up is the usual round-to-nearest algorithm used in European countries, in international financial dealings, and in the USA for tax calculations. round-half-even is often used for other applications in the USA, where it is usually called ‘round to nearest’ and is sometimes called ‘banker’s rounding’.


Another example of half-even rounding (in Saturn-based HP calculators):

1E12 1 - 2 / gives 500000000000 (rounded up from 499999999999.5)

1E12 3 - 2 / gives 499999999998 (rounded down from 499999999998.5)



I stumbled across the solution to this recently. Just change the display mode to FIX.


Hey thanks for that.....It seems to solve the problem! Genius!

However is there another way of doing this (so you don't have all these decimal places after a whole number for example.(like having just '3' on the stack and not '3.00000000...', depending on what FIX number you set)?

Edited: 7 Nov 2005, 9:24 p.m.

Possibly Related Threads...
Thread Author Replies Views Last Post
  Layout of arithmetic keys on early calculators Walter B 10 937 11-20-2013, 11:13 AM
Last Post: Jake Schwartz
  HP Prime program: rounding to a fraction Patrice 3 463 10-31-2013, 06:16 AM
Last Post: Joe Horn
  HP Prime: Rounding error in determinant Stephan Matthys 3 474 10-25-2013, 09:29 PM
Last Post: Walter B
  Rounding of 10^x Olivier De Smet 8 722 08-28-2013, 06:33 AM
Last Post: Dieter
  Arithmetic programs for HP39gII Mic 0 255 12-19-2012, 12:23 PM
Last Post: Mic
  Estimating Accumulated Rounding Errors Egan Ford 13 969 08-16-2012, 01:49 PM
Last Post: Egan Ford
  HP-34C Storage Register Arithmetic & Programming Matt Agajanian 14 1,121 05-08-2012, 11:04 AM
Last Post: Matt Agajanian
  HP48G Series Connectivity in a USB World Les Wright 3 455 05-06-2012, 01:29 AM
Last Post: Reth
  38E/C, 12C, 12CP date arithmetic bug Katie Wasserman 26 1,474 10-19-2011, 08:57 PM
Last Post: Miguel Toro
  WP34s: number display and rounding Dieter 4 395 10-14-2011, 05:11 PM
Last Post: Marcus von Cube, Germany

Forum Jump: