Post Reply 
(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
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
(12C) Decimal to Fraction - Gamo - 08-06-2018, 12:33 PM
RE: (12C) Decimal to Fraction - Dieter - 08-06-2018, 08:44 PM
RE: (12C) Decimal to Fraction - Dieter - 08-07-2018, 07:29 AM
RE: (12C) Decimal to Fraction - Dieter - 08-07-2018, 01:02 PM
RE: (12C) Decimal to Fraction - Dieter - 08-07-2018, 11:38 AM
RE: (12C) Decimal to Fraction - Gamo - 08-07-2018, 09:29 AM
RE: (12C) Decimal to Fraction - Joe Horn - 08-07-2018, 06:28 PM
RE: (12C) Decimal to Fraction - Dieter - 08-07-2018, 07:10 PM
RE: (12C) Decimal to Fraction - Joe Horn - 08-08-2018, 12:28 AM
RE: (12C) Decimal to Fraction - Dieter - 08-08-2018, 07:04 PM
RE: (12C) Decimal to Fraction - Dieter - 08-09-2018, 09:27 AM
RE: (12C) Decimal to Fraction - Dieter - 08-08-2018, 09:44 PM
RE: (12C) Decimal to Fraction - Gamo - 08-09-2018, 12:51 AM
RE: (12C) Decimal to Fraction - Dieter - 08-09-2018, 07:46 AM
RE: (12C) Decimal to Fraction - Albert Chan - 08-09-2018 02:17 AM
RE: (12C) Decimal to Fraction - Dieter - 08-09-2018, 08:09 AM
RE: (12C) Decimal to Fraction - Gamo - 08-09-2018, 09:16 AM
RE: (12C) Decimal to Fraction - Dieter - 08-09-2018, 10:30 AM
RE: (12C) Decimal to Fraction - Dieter - 08-10-2018, 12:28 PM
RE: (12C) Decimal to Fraction - Gamo - 05-07-2019, 01:44 AM
RE: (12C) Decimal to Fraction - Dieter - 08-10-2018, 07:06 PM



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