Find LCM of 2 numbers without using GCD
|
07-30-2018, 06:02 PM
Post: #6
|
|||
|
|||
RE: Find LCM of 2 numbers without using GCD
(07-30-2018 01:06 PM)Gamo Wrote: Found this topic interesting and would like to share the concept on how to find the LCM without first calculating the GCD. I assume you're especially interested in a version for the 12C, so here it is: Code: 01 X<=Y? The larger number is kept on the stack, the smaller one is in R0. 15 [ENTER] 20 [R/S] => 60 Additional feature: replace the last line with these ones.... Code: 18 X<>Y ... and you get both the LCM (in X) and the GCD (in Y). Dieter |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)