(48G) GCD: Greatest Common Divisor
|
08-31-2018, 02:06 PM
Post: #5
|
|||
|
|||
RE: (48G) GCD: Greatest Common Divisor
(08-31-2018 01:18 PM)Werner Wrote: Since GCD(x,y) = GCD(y,x) that makes no difference. If entered: 0 54 GCD, the code returned gcd of 54, as expected. If entered: 54 0 GCD, stack = {0 54} SWAP DUP2, stack = {54 0 54 0} Inside REPEAT, stack = {0 54 0} MOD, will do an illegal operation 54 % 0, thus ERROR BTW, I don't know what MOD will do for 54 % 0, ERROR was my guess. If the calculator returned x % 0 as x, then ignore my post. All is well ... |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)