(12C) Greatest Common Divisor

01062018, 12:29 AM
(This post was last modified: 01072018 02:35 AM by Gamo.)
Post: #1




(12C) Greatest Common Divisor
Quick and Simple program to find GCD of two integers.
Code:
Thanks to Dieter for the trick by make sure that Y is greater than X so ABS don't have to be use and here is the update program. Code:
Example: Test 1 GCD (256, 656) is 16 > 256 ENTER 656 R/S Test 2 GCD (12345, 67890) is 15 > 12345 ENTER 67890 R/S Remark: Test 2 will run faster on HP 12C+ Gamo 

01062018, 01:10 AM
Post: #2




RE: (12C) Greatest Common Divisor
I love your programs Gamo since I use the HP12C all the time! Thanks for the post.


01062018, 04:23 AM
Post: #3




RE: (12C) Greatest Common Divisor
Thank You Carsen
Gamo 

10082021, 08:08 AM
(This post was last modified: 10082021 08:15 AM by Gamo.)
Post: #4




RE: (12C) Greatest Common Divisor
Long time no update for the GCD program.
I dig around some HP manual and found the HP91 User's Manual on Page 122 demostrated the manually keys in steps to find GCD with this algorithm the slower computation speed on Original Classic HP12C will do really well and here I adapted this to run on the HP12C Code:
Example: GCD (153, 351) 153 [R/S] display 153 351 [R/S] display answer 9 GCD = 9 Gamo 10/2021 

« Next Oldest  Next Newest »

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