next up previous contents
Next: Complexity of Euclidean Algorithm Up: Rational numbers Previous: Continued Fractions   Contents

Continued fractions for irrationals

This can also be done for irrationals, but the continued fractions become infinite. For instance we can get approximations to $ \pi$ using the calculator. Take the integral part, print, subtract it, invert and repeat. We get $ \pi = [3,7,15,1,\dots ]$. The convergents are $ 3$, $ \frac{22}{7}$ and $ \frac{333}{106}$. We are already within $ 10^{-4}$ of $ \pi$. There is a good approximation as $ B_i$ increases. As an exercise, show that $ \sqrt{2} = [1,2,2,2,\dots]$.

root 2002-06-10