Continued Fraction Calculator | Convergents & Best Rational Approximations
Convert any decimal or fraction to its continued fraction expansion [a₀; a₁, a₂, ...] with up to 12 terms. Computes the full convergent table showing the best rational approximations at each step, the approximation error, and evaluates any given continued fraction back to its decimal value.
What Is the Continued Fraction Calculator | Convergents & Best Rational Approximations?
A continued fraction expresses a number as a nested sequence of integer parts and reciprocals. Every real number has a continued fraction expansion, and the expansion is finite for rational numbers and infinite for irrational ones. The convergents pₖ/qₖ are the best rational approximations — no fraction with a smaller denominator is closer to the value. The golden ratio φ=[1;1,1,1,…] has the slowest-converging continued fraction, making it the most irrational number.
Formula
x = a₀ + 1/(a₁ + 1/(a₂ + 1/(a₃ + …)))
Notation: x = [a₀; a₁, a₂, a₃, …]
Convergents: pₖ = aₖ·pₖ₋₁ + pₖ₋₂
qₖ = aₖ·qₖ₋₁ + qₖ₋₂
π = [3; 7, 15, 1, 292, …] | φ = [1; 1, 1, 1, …]
How to Use
- 1
Select mode: Decimal → CF, Fraction → CF, or Evaluate CF
- 2
For Decimal: enter any real number or click a preset (π, e, φ, √2, √3)
- 3
For Fraction: enter numerator and denominator
- 4
For Evaluate: enter terms as a₀; a₁, a₂, … e.g. "3; 7 15 1 292"
- 5
Click Compute
- 6
View the CF expansion and convergents table with errors
Choose a mode: Decimal → CF converts a decimal number, Fraction → CF converts p/q, and Evaluate CF reconstructs the decimal from a CF notation like [3;7,15,1,292]. Enter your value or load a preset (π, e, φ, √2, √3). Click Compute to see the CF expansion and the convergents table.
Example Calculation
Example: π = 3.14159265…
CF: [3; 7, 15, 1, 292, 1, 1, …]
k=0: p/q = 3/1 = 3 error = 0.14159…
k=1: p/q = 22/7 ≈ 3.142857 error = 1.26×10⁻³
k=2: p/q = 333/106 ≈ 3.14151 error = 8.3×10⁻⁵
k=3: p/q = 355/113 ≈ 3.14159292 error = 2.67×10⁻⁷
Frequently Asked Questions
Why is 22/7 a good approximation for π?
The CF of π is [3;7,15,1,292,…]. The large partial quotient 292 after the first few terms means the previous convergent 355/113 is an exceptionally good approximation (error ≈ 2.67×10⁻⁷). The fraction 22/7 is the simpler convergent at k=1, and no fraction with a denominator smaller than 113 is closer to π than 355/113.
What makes the golden ratio special in continued fractions?
The golden ratio φ = (1+√5)/2 has the CF [1;1,1,1,…] — all partial quotients equal 1. This makes its convergents (the Fibonacci ratios F_{n+1}/F_n) converge the most slowly of any irrational number. This is why the golden ratio appears in optimal sunflower spirals and phyllotaxis.
Do rational numbers have finite continued fractions?
Yes. Every rational number p/q has a finite CF expansion, and the algorithm terminates in exactly the same steps as the Euclidean GCD algorithm. Irrational numbers have infinite expansions, which are eventually periodic exactly for quadratic irrationals like √2, √3, and φ.
What is a convergent?
The k-th convergent pₖ/qₖ is formed by truncating the CF at the k-th level. It is always the best rational approximation to the original number among all fractions whose denominator does not exceed qₖ. Convergents alternate above and below the true value.
You Might Also Like
Explore 360+ Free Calculators
From math and science to finance and everyday life — all free, no account needed.