Post Reply 
(48G) GCD: Greatest Common Divisor
08-31-2018, 11:40 PM
Post: #9
RE: (48G) GCD: Greatest Common Divisor
(08-31-2018 10:08 PM)rprosperi Wrote:  
(08-31-2018 03:46 PM)Albert Chan Wrote:  You mean it work for *all* 3 programs ?
Klemm version work. I was referring to the other two ...

I just downloaded Hp50g emulator: 54 0 MOD return ?, not 54

No, sorry I was not clear, I was referring to Werner's program; I thought that was the one you were referencing.

Turns out, we are both right (with Werner's program):

With approx mode: 54 0 GCD returns 54 (calculator assumed 54 % 0 = 54)
Under exact mode: 54 0 GCD returns '?' (technically, 54 % 0 is undefined)

In fact, Werner's code will not work in exact mode at all, except for initial Y = 0.
It always return '?', because X always reduced to zero, causing undefined Y % X.

Hp50g emulator is fun Smile
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: (48G) GCD: Greatest Common Divisor - Albert Chan - 08-31-2018 11:40 PM



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