How to convert a decimal to a fraction easily? Given a decimal like $1.5$, I want to find an easy way to write it as $3/2$ in this case is easy but given a decimal such as $0.3760683761$, how could I figure out it can be written as $572/1521$? Thx.

Edit

In case anyone is interested in more about this, I found the following links (more could exist, but what I have is enough - Thx to your contributions):

Link 1, Link 2
Here's a different way to proceed, using as little as possible of the theory of continued fractions.  First write $$\frac01 &lt; 0.3760683761 &lt; \frac11$$ so right away we have a pair of fractions that approximate 0.3760683761.  They are  not very good approximations though! 

Now if we have $\frac ab$ on the left and $\frac cd$ on the right, we should check $\frac{a+c}{b+d}$ to see where it lies.  In this case $\frac ab = \frac01$ and $\frac cd = \frac 11$ so $\frac{a+c}{b+d} = \frac{0+1}{1+1} = \frac12 = 0.5$:

$$\frac01 &lt; 0.3760683761 &lt; \frac12&lt; \frac 11$$ 

so forget about $\frac11$, which is too big.  Now repeat:  Next is $\frac{0+1}{1+2} = \frac13$, which is too small:

$$\frac01&lt; \frac13 &lt; 0.3760683761 &lt; \frac12$$ 

Next is $\frac{1+1}{2+3} = \frac25$, which is too big:

$$\frac13 &lt; 0.3760683761 &lt; \frac25 &lt; \frac12$$

Next is $\frac{1+2}{3+5} = \frac38 = 0.375$, which is an excellent approximation:

$$\frac13 &lt; \frac38 &lt; 0.3760683761 &lt; \frac25 $$

Unfortunately for this example, there is no better approximation than $\frac38$ until we get to $\frac{44}{117}$.  usually the convergence is quicker, but this happens to be an unusually badly-behaved example, and so takes several more steps:

$$\frac13 &lt; \frac38 &lt; \frac{44}{117} &lt;  0.3760683761&lt; \frac{41}{109} &lt; \cdots &lt; \frac{17}{45} &lt; \frac{14}{37} &lt; \frac{11}{29} &lt; \frac8{21} &lt; \frac 5{13} &lt; \frac25 &lt; \frac12$$

But it does find $\frac{44}{117} \approx .37606837606837606837$, which is extremely close, and perhaps is what you were looking for.  On the other hand perhaps $\frac 38$ was close enough and you could stop there.

If you want $0.3760683761$ exactly, you can continue the process, which will eventually terminate with exactly $\frac{3760683761}{10000000000}$.

One pleasant feature of this algorithm is that it always produces fractions in lowest terms, so you never have to worry about reducing them afterwards.

The theory of continued fractions provides a way to perform this calculation much more quickly, producing the continued fractional result $$0.3760683761 \approx \cfrac1{2+\cfrac 1{1+\cfrac1{1+\cfrac1{1+\cfrac1{14}}}}}$$
The theory of primes is that any number can be written as a product of prime factors, so 572/1521 can be written as 2*2*11*13 / 3*3*13*13 which reduces down to 44/117.

The theory of decimals is that any decimal number can be written as a product and ratio using three whole numbers, e.g. xxx.xxxx = A * B/C.