Find LCM of 2 numbers without using GCD
08-01-2018, 09:04 PM (This post was last modified: 08-01-2018 11:28 PM by Albert Chan.)
Post: #22
 Albert Chan Senior Member Posts: 1,118 Joined: Jul 2018
RE: Find LCM of 2 numbers without using GCD
uh, did it miss a subtract on line 3 ? looks like Y pushed away

when X and Y are both negative, the mod will stay negative all the way to the end

I still like the mod, and would like program to pull double duty.
How about it only does the loop only if X was negative ?

so, this will get the gcd

54321 CHS Enter 12345 CHS R/S --> -3

that will be awesome ...

Edit: my mistake, it was CLX not LstX. That was a nice trick ...
 « Next Oldest | Next Newest »

 Messages In This Thread Find LCM of 2 numbers without using GCD - Gamo - 07-30-2018, 01:06 PM RE: Find LCM of 2 numbers without using GCD - Albert Chan - 07-30-2018, 02:42 PM RE: Find LCM of 2 numbers without using GCD - Thomas Klemm - 07-30-2018, 04:07 PM RE: Find LCM of 2 numbers without using GCD - Dieter - 07-30-2018, 06:22 PM RE: Find LCM of 2 numbers without using GCD - Thomas Klemm - 07-30-2018, 04:41 PM RE: Find LCM of 2 numbers without using GCD - Albert Chan - 07-30-2018, 06:13 PM RE: Find LCM of 2 numbers without using GCD - Dieter - 07-30-2018, 06:42 PM RE: Find LCM of 2 numbers without using GCD - Gamo - 07-30-2018, 05:46 PM RE: Find LCM of 2 numbers without using GCD - Dieter - 07-30-2018, 06:02 PM RE: Find LCM of 2 numbers without using GCD - Thomas Klemm - 07-30-2018, 06:21 PM RE: Find LCM of 2 numbers without using GCD - Thomas Klemm - 07-30-2018, 06:47 PM RE: Find LCM of 2 numbers without using GCD - Thomas Klemm - 07-30-2018, 07:43 PM RE: Find LCM of 2 numbers without using GCD - Albert Chan - 07-30-2018, 11:31 PM RE: Find LCM of 2 numbers without using GCD - Gamo - 07-31-2018, 02:07 AM RE: Find LCM of 2 numbers without using GCD - Dieter - 07-31-2018, 07:05 AM RE: Find LCM of 2 numbers without using GCD - Paul Dale - 07-31-2018, 07:48 AM RE: Find LCM of 2 numbers without using GCD - Albert Chan - 07-31-2018, 12:41 PM RE: Find LCM of 2 numbers without using GCD - Gamo - 07-31-2018, 01:28 PM RE: Find LCM of 2 numbers without using GCD - Dieter - 07-31-2018, 03:51 PM RE: Find LCM of 2 numbers without using GCD - Albert Chan - 07-31-2018, 06:10 PM RE: Find LCM of 2 numbers without using GCD - Dieter - 08-01-2018, 08:15 PM RE: Find LCM of 2 numbers without using GCD - Albert Chan - 08-01-2018 09:04 PM RE: Find LCM of 2 numbers without using GCD - Albert Chan - 08-02-2018, 01:25 AM RE: Find LCM of 2 numbers without using GCD - Dieter - 08-02-2018, 01:03 PM RE: Find LCM of 2 numbers without using GCD - Albert Chan - 08-02-2018, 01:26 PM RE: Find LCM of 2 numbers without using GCD - Thomas Okken - 08-02-2018, 03:52 PM RE: Find LCM of 2 numbers without using GCD - Dieter - 08-02-2018, 04:35 PM RE: Find LCM of 2 numbers without using GCD - Albert Chan - 08-02-2018, 05:48 PM RE: Find LCM of 2 numbers without using GCD - Thomas Okken - 08-02-2018, 05:54 PM

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