Post Reply 
Find LCM of 2 numbers without using GCD
07-31-2018, 03:51 PM (This post was last modified: 07-31-2018 03:52 PM by Dieter.)
Post: #19
RE: Find LCM of 2 numbers without using GCD
(07-31-2018 01:28 PM)Gamo Wrote:  I have to break Dieter hearth by using 3 registers on this program.

Yes, especially since my version above implements the same algorithm with merely one single data register. And two steps less. #-)

But your three-register version may run slightly faster. And you can save several steps:

Code:
01 X≤Y?
02 X<>Y
03 STO 2
04 STO 0
05 X<>Y
06 STO 1
07 RCL 0
08 RCL 1
09 ÷
10 FRAC
11 X=0?
12 GTO 16
13 RCL 2
14 STO+0
15 GTO 07
16 RCL 0
17 GTO 00

Dieter
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Find LCM of 2 numbers without using GCD - Dieter - 07-31-2018 03:51 PM



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