Post Reply 
H->HMS conversion HP-15C vs. HP42S vs HP67
09-06-2018, 05:31 PM (This post was last modified: 09-06-2018 05:56 PM by Dieter.)
Post: #13
RE: H->HMS conversion HP-15C vs. HP42S vs HP67
(09-06-2018 05:14 PM)burkhard Wrote:  I think you have a typo above. For Step 2, I think you probably actually got 146,9066666.

Yes, sure. I also noticed this and corrected it a few minutes after my post. Obviously in the meantime you were already writing your reply. ;-)

(09-06-2018 05:14 PM)burkhard Wrote:  183,38 →H gives 183.6444444 (Ahah...Most singular, Dr. Watson!)

There we are.
So there seems to be a problem in the →H code.

EDIT AND UPDATE:
I now have an idea of what might be going on here: it looks like the usual binary roundoff problem.
This 15C simulator seems to use binary arithmetics as most computer hardware does. This means that 183,38 cannot be represented exactly as a binary value and its decimal equivalent may be 183,37999999999... While decomposing the input into hours, minutes and seconds this in turn is interpreted as 183 hours, 37 minutes and 99,99999... seconds. Et voilà: this indeed equals 183,6444444... hours.

Case closed ?-)

BTW, this issue – converting between decimal hours and h.mmss using binary arithmetics – has been discussed here in detail some time ago. A reliable algorithm that minimizes or even eliminates the risk of roundoff errors (like the one shown above) requires very careful coding, and some solutions have been proposed.

Dieter
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: H->HMS conversion HP-15C vs. HP42S vs HP67 - Dieter - 09-06-2018 05:31 PM



User(s) browsing this thread: 22 Guest(s)