Find LCM of 2 numbers without using GCD
|
08-02-2018, 01:25 AM
(This post was last modified: 08-02-2018 06:58 PM by Albert Chan.)
Post: #23
|
|||
|
|||
RE: Find LCM of 2 numbers without using GCD
Here is my revised Mod/Gcd program for HP-12C
If Y, X both negative, it does Gcd(Y, X) If Y, X both positive, it does Mod(Y, X) If X = 0, return Y Example: 54321 CHS Enter 12345 CHS R/S => -3 ; Gcd 54321 Enter 12345 R/S => 4941 ; Mod(54321, 12345) R/S => 2463 ; Mod(12345, 4941) R/S => 15 ; Mod(4941, 2463) R/S => 3 ; Mod(2463, 15) R/S => 0 ; Mod(15, 3) R/S => 3 ; Gcd Code: 01 X = 0 |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 4 Guest(s)