The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 795 - File: showthread.php PHP 7.4.33 (FreeBSD)
File Line Function
/showthread.php 795 errorHandler->error





Post Reply 
Help with an algorithm for converting decimals to fractions
08-27-2014, 08:55 PM (This post was last modified: 08-27-2014 08:56 PM by Namir.)
Post: #1
Help with an algorithm for converting decimals to fractions
I posted an HP Prime program that calculates the integer fractions that approximate a number with decimals (for a user-specified number of continued fraction coefficients). See the HP Prime listing if my description is ambiguous. The program uses an array to store the coefficients of the continued fraction. The program then uses the values in this array to calculate the final numerator and denominator that approximate the input decimal value.

The Math Pac for the HP-7 has a program that performs a similar task. I believe it does its task WITHOUT using an array to store the coefficients of the continued fraction!!

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.

I appreciate your input!

:-)

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


Messages In This Thread
Help with an algorithm for converting decimals to fractions - Namir - 08-27-2014 08:55 PM



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