Let x be the given real number. The first step in finding the continued fraction for x is to find the largest integer a less than or equal to x. Sometimes this is called the "greatest integer" in x and sometimes it's called the "floor" of x. We'll call it the floor. For example, the floor of 7/3 is 2. Note that the floor of an integer is that integer itself. For example, the floor of 3 is 3. In the following diagram, all numbers between 0 and 1 have a floor value of a = 0; those between 1 and 2 have a floor value of 1, indicated in light red; those between 2 and 3 have a floor value of 2, indicated in orange; and so forth.
and do the same thing to it. Start by taking its floor b. Since y is close to b, therefore 1/b is close to y which is x a. Therefore, a + 1/b is close to x.
The next diagram shows the value for b on the second line below the values for a. The same color coding is used.
These figures utilize the Geometry Applet.
April, 2006.
David E. Joyce
Department of Mathematics and Computer Science
Clark University
Worcester, MA 01610
The address of this file is http://aleph0.clarku.edu/~djoyce/java/Geometry/contfract.html