HP Forums
(12C) Add & Subtract with Fraction revisit - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Software Libraries (/forum-10.html)
+--- Forum: General Software Library (/forum-13.html)
+--- Thread: (12C) Add & Subtract with Fraction revisit (/thread-22136.html)



(12C) Add & Subtract with Fraction revisit - Gamo - 08-07-2024 07:12 AM

This program is adapted from "(25) Programmsammlung" on page 56

https://www.hpmuseum.org/forum/thread-22132.html

-----------------------------------------------------------------------------

This program can do addition and subtraction with fraction in series as

demonstrated on page 56.

------------------------------------------------------------------------------
Example: Each new problem first clear store register [f] REG

19/180 - 17/871 + 19/91 = ?

[f] REG

19 [ENTER] 180 [R/S] display 19

17 [CHS] [ENTER] 871 [R/S] display 156780

19 [ENTER] 91 [R/S] display 1097460 (denominator ) [X<>Y] 323563 (numerator)

Answer: 323563 / 1097460

-----------------------------------------------------------------------------
Program:
Quote:01 STO 1
02 X<>Y
03 STO 0
04 R/S
05 STO 3
06 X<>Y
07 STO 2
08 RCL 0
09 RCL 3
10 x
11 RCL 1
12 RCL 2
13 x
14 +
15 STO 0
16 0
17 X<>Y
18 X≤Y
19 CHS // Line 16 - 19 is the [ABS] function
20 STO 4
21 RCL 1
22 RCL 3
23 x
24 STO 1
25 0
26 X<>Y
27 X≤Y
28 CHS // Line 25 -28 is the [ABS] function
29 STO 5
30 RCL 4
31 RCL 5
32 ÷
33 FRAC
34 RCL 5
35 x
36 . // decimal point
37 5
38 +
39 INTG
40 X=0
41 GTO 47
42 RCL 5
43 STO 4
44 X<>Y
45 STO 5
46 GTO 30
47 RCL 5
48 STO÷0
49 STO÷1
50 RCL 0
51 RCL 1
52 GTO 04

Gamo 8/2024