(11C) Arithmetic with Fractions

09172018, 04:04 PM
(This post was last modified: 09192018 05:09 PM by Albert Chan.)
Post: #11




RE: (11C) Arithmetic with Fractions
(09172018 01:12 AM)Albert Chan Wrote: Hi, Thomas Klemm, I made up a better example, to show Kahan's algorithm, where mixed fraction trick won't work: M/N = 1234567/12345648  635720/6357263 From Kahan's paper: (using HP12C, with my Mod/Gcd program) G = gcd(12345648, 6357263) = 181 b = 12345648 / 181 = 68208 d = 6357263 / 181 = 35123 a = 1234567 % 181 = 147 c = 635720 % 181 = 48 ad  bc = 147*35123  68208*48 = 1889097 = 181 * 10437 g =gcd(G, ad  bc) = 181 M = 10437 + Det({{6820, 68208}, {3512, 35123}}) = 10437  7636 = 2,801 N = G/g * b * d = 68208 * 35123 = 2,395,669,584 

« Next Oldest  Next Newest »

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