Post Reply 
(11C) Arithmetic with Fractions
09-17-2018, 01:12 AM
Post: #6
RE: (11C) Arithmetic with Fractions
Hi, Thomas Klemm,

Thanks for the link to Kahan paper. I tried it, it work perfectly.

However, Kahan's example does not shown the algorithm's power.
Doing the math as fixed fraction already avoid the overflow problem ...

123456799/123456 - 988297396/988291
= (1000 + 799/123456) - (1000 + 6396/988291)
= 799/(643*192) - 6396/(643*1537)
= (799 * 1537 - 6396 * 192) / (643*192*1537)
= (1228063 - 1228032) / 189751872
= 31 / 189751872
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
(11C) Arithmetic with Fractions - Gamo - 09-15-2018, 07:02 AM
RE: (11C) Arithmetic with Fractions - Albert Chan - 09-17-2018 01:12 AM
RE: (11C) Arithmetic with Fractions - Gamo - 09-17-2018, 03:47 AM
RE: (11C) Arithmetic with Fractions - Gamo - 09-17-2018, 09:40 AM
RE: (11C) Arithmetic with Fractions - Gamo - 09-22-2018, 06:33 AM



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