(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 ? 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 |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 5 Guest(s)