Re: Fast Reduced Fractions...


[Prev][Next][Index][Thread]

Re: Fast Reduced Fractions...



Oh sorry! I felt all speacial.  But I doo have a suggestion, why don't you
enter the decimal as a string then find the length , convert the string
to I guess a double and then multiply it by a power of ten to make it an
integer. Then use the integer and the power of ten as you numerator and
denominator and then use the code I gave you or whatever.  Oh and by the
way count down not up I made that mistake myself.

-DG-



On Mon, 26 Mar 2001, Thomas J. Hruska wrote:

> At 10:22 AM 3/26/01 -0500, you wrote:
> >Hey excellent man I just finished doing one for my COMPUTER SCIENCE class
> >here it is And it is in C++.
>
> Umm...well, I know how to reduce the fraction once I have a correct
> numerator and denominator.  You are assuming that I know the numerator and
> denominator which is not true.  I have a *decimal number* (Example:
> .578695786957869...) that has an accuracy of 15-20 digits that I want to
> convert to a correct reduced fraction in a single pass.
>
> Well, someone just gave me a possible solution, but it doesn't convert the
> number in a single pass like I want to.  It also doesn't eliminate the
> problem that I only have 15-20 digits of precision.
>
> Time to hit the books...
>
>
>            Thomas J. Hruska -- shinelight@crosswinds.net
> Shining Light Productions -- "Meeting the needs of fellow programmers"
>                   http://www.shininglightpro.com/
>
> ******************************************************************
> * To UNSUBSCRIBE, send an email TO: listserv@lists.ppp.ti.com
> * with a message (not the subject) that reads SIGNOFF CALC-TI
> *
> * Archives at http://peach.ease.lsoft.com/archives/calc-ti.html
> ******************************************************************
>

******************************************************************
* To UNSUBSCRIBE, send an email TO: listserv@lists.ppp.ti.com
* with a message (not the subject) that reads SIGNOFF CALC-TI
*
* Archives at http://peach.ease.lsoft.com/archives/calc-ti.html
******************************************************************


References: