The Museum of HP Calculators

HP Forum Archive 06

 HMS Calculations 28S vs 42SMessage #1 Posted by Chris Randle (Lincoln, UK) on 8 Oct 2001, 10:26 p.m. I have been comparing my newly acquired 28S with my 42S. The 28S has special functions for adding numbers in HMS (hours/degrees minutes seconds) format whereas the 42S requires that you convert to degrees, add and convert back. On the 28S, I did 0.3 [ENTER] 0.2 [HMS+] -> 0.5 (as expected) On the 42S, I did 0.3 [->HR] 0.2 [->HR] [+] [->HMS] -> 0.5 (as expected) BUT if I mimic the 42 on the 28 and repeat the above calculation, I get 0.496. At first I was surprised at the apparent discrepancy. 0.496 is a long way short of 0.5. Then I realised that in HMS it's not. I presume that the "problem" was caused by the 0.2 (20 minutes) converting to 0.3333... However, I would have expected the 28 either to return 0.4959999... or else 0.5. 0.496 in HMS is 49 minutes and 60 seconds, i.e. 50 minutes, so why does the 28 not "realise" that. Any explanation would be much appreciated.

 Re: HMS Calculations 28S vs 42S - bug?Message #2 Posted by Vieira, Luiz C. (Brazil) on 9 Oct 2001, 12:39 a.m.,in response to message #1 by Chris Randle (Lincoln, UK) You're right. Now there are two wondering for an answer.

 Re: HMS Calculations 28S vs 42S - bug?Message #3 Posted by Chris Randle (Lincoln, UK) on 9 Oct 2001, 3:40 p.m.,in response to message #2 by Vieira, Luiz C. (Brazil) OK. I've come to the conclusion that it's not a bug. In fact, I think it's a particularly elegant feature(!) although I can't find any reference to it in the manuals. Obviously, adding HMS numbers without using the HMS+ function is a bit daft, but the problem will also surface if you do: 0.2 [HMS->] [->HMS] which yields 0.196. Again, the 42S has no "problem" with this. Here's my take on it: You know how SIN(pi), when pi is expressed as a number, isn't zero? That's because the numeric pi isn't (and never can be) exactly pi. I think HP went looking for more places to be pedantic. 20 minutes expressed as degrees is 0.333... recurring. So when you convert 0.333... (to the limit of the calculator's accuracy) back to minutes, it says "well, it's not exactly 20 minutes, more like 19 minutes 60 seconds". It's quite clever really. It's the same thing, but it warns you that it's not necessarily quite right. I was thinking this could be extended to 1 [ENTER] 3 / 3 * resulting in 0.X where X would be a new symbol for ten as in the Roman X. "Nought point ten" is 1, but not quite!

 Re: HMS Calculations 28S vs 42S - bug?Message #4 Posted by Vieira, Luiz C. (Brazil) on 9 Oct 2001, 7:22 p.m.,in response to message #3 by Chris Randle (Lincoln, UK) Sorry, but... I still cannot look at a 0.60 degrees as equals to 1.0. I accept a 60 minutes equals to 1 degree, but a 0.60 ... I have never seen a 1 degree expressed this way, I don't know. I understand your concerns cause they are mine, too: is it O.K.? I would accept (as it seems to happen in the 42S) that an angle expressed as 1.59599999, or 1°59'59"999999 is rounded to 2°00'00"000 so the equipment does not have more digits to express the meaningful last ones. Otherwise, there is no rounding function for a HHH.MMSSss representation, cause if you try to round 1.59599999 to three decimal places, you have 1.596. The calculator does not know if this is a representation of an angle (or time measurement) or a decimal number itself. I believe the rounding occurs in the 28S after conversion, and this was corrected in the newer systems (42S, 48/49), so the rounding procedure occurs in the decimal internal number, before calculating its HHH.MMSSss representation. Just try this in the 42S: enter 5.95999999999 E-1; (as many 9īs) add 1; show the mantissa: 1596000000000 Any ideas?

 Re: HMS Calculations 28S vs 42S - bug?Message #5 Posted by W. Bruce Maguire II on 10 Oct 2001, 12:19 p.m.,in response to message #3 by Chris Randle (Lincoln, UK) Chris: I'm not sure whether I would weigh in on the side of a bug or not, but I think your explanation is quite clever! The HP engineers (probably exiled in favor of art designers whose value-add is ice-blue cases!) might say, "Uh...yeah...that's it...that's exactly what we were thinking..." Bruce.

 Re: HMS Calculations 28S vs 42SMessage #6 Posted by Vassilis Prevelakis on 9 Oct 2001, 3:52 a.m.,in response to message #1 by Chris Randle (Lincoln, UK) Chris Randle wrote: > I have been comparing my newly acquired 28S with my 42S. > The 28S has special functions for adding numbers in HMS > (hours/degrees minutes seconds) format whereas the 42S > requires that you convert to degrees, add and convert back. What? since the 42S is compatible with the HP-41 it must have the HMS+ function. Am I missing something? **vp

 Re: HMS Calculations 28S vs 42SMessage #7 Posted by Chris Randle (Lincoln, UK) on 9 Oct 2001, 6:43 a.m.,in response to message #6 by Vassilis Prevelakis You're quite right. The 42S does have HMS+ and HMS-. I didn't spot them because they're in the catalog, but not assigned to any menu (that I could find). However, my beef isn't with the 42, it doesn't get flustered whichever way you do the calculation. I can't even say that the 28's problem is a rounding error (although I suspect that ultimately it must be) because if you subtract 0.496 from the result on the stack, you get a resounding zero.

 Re: HMS Calculations 28S vs 42SMessage #8 Posted by Tom (UK) on 9 Oct 2001, 1:42 p.m.,in response to message #7 by Chris Randle (Lincoln, UK) What happens if you play with the 0.496 answer? Like add 1 second, then subtract 1 second?

 Re: HMS Calculations 28S vs 42SMessage #9 Posted by Chris Randle (Lincoln, UK) on 9 Oct 2001, 3:44 p.m.,in response to message #8 by Tom (UK) If I use 0.0001 [HMS+] 0.0001 [HMS-], I end up with 0.5. If I avoid the HMS+/- functions and convert everything to degrees, add, subtract, then convert back, I'm left with 0.496 again. I've convinced myself that it's actually a very clever feature and I've posted a possible explanation elsewhere in this thread.

Go back to the main exhibit hall