Post Reply 
(11C) Greatest Common Divisor
01-08-2018, 01:29 AM
Post: #2
RE: (11C) Greatest Common Divisor
Another great version from member name Csaba Tizedes mention:

There is a 15C version as per Marcus du Sautoy explanation (in TV show 'Secrets Of Modern Living: Algorithms')

Also work for HP-11C

Code:

LBL E
x=y     / there are the two numbers are equal?
RTN     / yes, stop here and the GCD on the display
x>y     / no, check there are the smaller number in x?
x<>y   / no, chsnge x and y
  -       / let's substract it
LSTx   / and get back the number of x
GTO E / and again until numbers are equal

Here is the link to this discussion: http://www.hpmuseum.org/forum/thread-652...l#pid77428

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


Messages In This Thread
(11C) Greatest Common Divisor - Gamo - 12-31-2017, 05:14 AM
RE: (11C) Greatest Common Divisor - Gamo - 01-08-2018 01:29 AM



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