09-23-2018, 09:24 AM
Program to add, subtract, multiply, divide, simplify to lowest term and
convert to mixed fraction.
All procedure is the same from previous post for the
(11C) Arithmetic with Fractions.
This program is the updated version from 11C that improve the computation speed by using better GCD algorithm.
(11C) Arithmetic with Fractions link page at
http://www.hpmuseum.org/forum/thread-11400.html
Here is the clips of this updated version
https://youtu.be/wRrKXyRVof8
Program: 87 program lines
This add-on section is for "Decimal to Fraction" Program
Procedure:
Display X.xxxx.... [GSB] 1 display Numerator [X<>Y] Denominator
If Numerator is larger than Denominator Press [E] for Mixed Fraction
Example: FIX 4
e^1 = 2.7183
[GSB] 1 display 193 [X<>Y] 71
answer is 193/71
[E] display 2.0051 [X<>Y] 71
Mixed Fraction answer is 2+ 51/71
Program: Decimal to Fraction [Total 132 program steps]
Gamo
convert to mixed fraction.
All procedure is the same from previous post for the
(11C) Arithmetic with Fractions.
This program is the updated version from 11C that improve the computation speed by using better GCD algorithm.
(11C) Arithmetic with Fractions link page at
http://www.hpmuseum.org/forum/thread-11400.html
Here is the clips of this updated version
https://youtu.be/wRrKXyRVof8
Program: 87 program lines
Code:
LBL A // Store Fractions
STO 4
Rv
STO 3
Rv
STO 2
Rv
STO 1
CLx
RTN
--------------------------------------------------------
LBL B // Add or Subtract
RCL 1
RCL 4
x
RCL 2
RCL 3
x
+
STO 5
RCL 2
RCL 4
x
STO 6
GTO 5
-----------------------------------------------------------
LBL C // Multiply
RCL 1
RCL 3
x
STO 5
RCL 2
RCL 4
x
STO 6
RCL 5
GTO 5
----------------------------------------------------------
LBL D // Divide
RCL 1
RCL 4
x
STO 5
RCL 2
RCL 3
x
STO 6
RCL 5
LBL 5 // Reduce Fractions using GCD
ENTER
ENTER
CLx
+
Rv
÷
LSTx
X<>Y
INT
x
-
TEST 0 // X≠0
GTO 5
+
RCL 6
X<>Y
÷
RCL 5
LSTx
÷
RTN
--------------------------------------------------
LBL E // Mixed Fraction
STO 0
÷
LSTx
X<>Y
ENTER
FRAC
X<>Y
INT
Rv
x
EEX
4
÷
R^
+
FIX 4
RCL 0
X<>Y
RTN
This add-on section is for "Decimal to Fraction" Program
Procedure:
Display X.xxxx.... [GSB] 1 display Numerator [X<>Y] Denominator
If Numerator is larger than Denominator Press [E] for Mixed Fraction
Example: FIX 4
e^1 = 2.7183
[GSB] 1 display 193 [X<>Y] 71
answer is 193/71
[E] display 2.0051 [X<>Y] 71
Mixed Fraction answer is 2+ 51/71
Program: Decimal to Fraction [Total 132 program steps]
Code:
LBL 1
STO 0
STO 1
0
ENTER
ENTER
1
R^
LBL 2
INT
R^
x
+
STO 2
GSB3
X<>Y
÷
RND
RCL 0
RND
X=Y
GTO 4
+
CLx
RCL 2
ENTER
ENTER
R^
RCL 1
FRAC
1/x
STO 1
GTO 2
LBL 4
RCL 2
LBL 3
ENTER
ENTER
RCL 0
x
.
5
+
INT
RTN
Gamo