HP Forums
(30b) Euclidean GCD Programme - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Software Libraries (/forum-10.html)
+--- Forum: General Software Library (/forum-13.html)
+--- Thread: (30b) Euclidean GCD Programme (/thread-2449.html)



(30b) Euclidean GCD Programme - Gerald H - 11-19-2014 01:58 PM

Returns GCF of integers in X & Y registers to X register:

0 P2
1 =
2 3
3 0
4 0
5 STO Mode
6 R↓
7 Lbl 02
8 /
9 Ans
10 Swap
11 Math
12 Up
13 Input
14 Swap
15 *
16 Ans
17 Swap
18 RND
19 Input
20 GT 02
21 R↓
22 3
23 1
24 2
25 STO Mode
26 R↓
27 X^2
28 √
29 RTN

Lines 22 to 25 return the display to the BEST mode from the FIX 0 mode used in the programme.