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