Post Reply 
HP-15C time calculating program
08-30-2024, 04:06 PM (This post was last modified: 08-30-2024 04:54 PM by C.Ret.)
Post: #5
RE: HP-15C time calculating program
Yes, indeed it is very tempting to use a modulo of 12 to simplify the code.
But a modulo of 12 returns numbers between 0 and 11. Here, we need an interval between 1 and 12. A small shift can do the trick in a minimum of steps:
Code:
001-42,21,11   f LBL A
002-    43 2   g →H
003-45,40,25     RCL+I
004-45,30, 1     RCL-1
005-45,10, 0     RCL÷0
006-   42 44   f FRAC
007-45,20, 0     RCL×0
008-45,30, 1     RCL+1
009-    42 2   f →H.MS
010-   43 32   g RTN
With parameters:
f FIX 4
12 STO 0 for 12-O'Clock systems (Alternatively 24 STO 0 for 24hr dial systems).
1 STO 1 for 1 - 12 hours range (Alternatively 0 STO 1 for 0-23 range display).
4.3400 g →H STO f I to get 4 h 34 min 00 second reacting length time.
Usage: Enter starting time and press f A, the HP-15C display the ending time.
Examples: Typical 12-hour clock system: 12 STO 0, 1 STO 1, 4.34 g →H STO f I
7        f A        ⇒        11.3400
7.30      f A        ⇒        12.0400
8        f A        ⇒        12.3400
8.23      f A        ⇒        12.5700
8.3015     f A        ⇒        1.0415
9        f A        ⇒        1.3400
9.4523     f A        ⇒        2.1923
11.15      f A        ⇒        3.4900
12.05      f A        ⇒        4.3900
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: HP-15C time calculating program - C.Ret - 08-30-2024 04:06 PM



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