Follow integer divisions, track rational errors and navigate the fraction tree.
Rational laboratory
A mediant adds the two numerators and the two denominators, then reduces the result.
Your construction
Enter your result or navigate the tree.
Rational approximation error
Orange: best error up to q · Blue: convergent · Pink: your fraction
Fraction-tree path
Fraction Finder complete!
The maths
A rational continued fraction is produced by repeated division with a non-negative remainder. Each prefix gives a convergent p/q.
The best bounded-denominator approximation minimises |x − p/q| for 1 ≤ q ≤ Q. Convergents and certain intermediate fractions provide particularly good approximations.
The continued fraction for a non-square positive integer's square root has a periodic tail. A greedy Egyptian expansion repeatedly subtracts the largest unit fraction no greater than the remainder.
A mediant is (a+c)/(b+d). In the Stern–Brocot tree, left and right choices successively narrow the interval containing a positive rational target.