(12C) Decimal to Fraction
|
08-09-2018, 02:17 AM
(This post was last modified: 08-09-2018 02:45 AM by Albert Chan.)
Post: #26
|
|||
|
|||
RE: (12C) Decimal to Fraction
Hi Thomas,
I was in the middle of typing this, when I see you fixed the code. Anyway, below illustrated why I request the fix. Try 0.10322, approx. with fraction, denominator <= 1e8 Using Mathematica, Continued Fraction coefficient = [0,9,1,2,4,1,6,2,1,4,3] With HP-12C, due to rounding error, I get [0,9,1,2,4,1,6,2,1,4,2,1,64,1,4,3,1,74139, ...] -> original setup, last 2 quotients = 68773261, 5098833198335 -> the big quotient rounded down in HP-12C to 5098833198000 -> interpolated quotient = 5098833198000 - 74139 * 68773261 = 52401000 (HP-12C rounded) -> fraction = 5408831 / 52401000 = 0.103219996 The fraction is wrong. Even with bad continued fraction coefficients, value should be very close to 0.10322 This is what the patched version does to above: -> fraction = 5408837 / 52401056 = 0.1032200000 |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)