Post Reply 
Help with an algorithm for converting decimals to fractions
08-27-2014, 10:12 PM
Post: #2
RE: Help with an algorithm for converting decimals to fractions
(08-27-2014 08:55 PM)Namir Wrote:  My question to you all (and especially Jo Horn) is, "What is the algorithm that converts decimals to fractions that does not use an array to store the coefficients of the continued fraction. I will be happy if you give me a general algorithm.

The 34S doesn't hold the coefficients. See decn.c, function decNumber2Fraction. The code repeatedly takes the reciprocal of the fractional part and maintains a running fraction.

I didn't analyse the stability of this approach but it seems okay enough.


- Pauli
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Help with an algorithm for converting decimals to fractions - Paul Dale - 08-27-2014 10:12 PM



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