Skip to content
ENExplore Calculators

Continued Fraction Calculator

Work out continued fraction instantly with clear inputs, formula shown and shareable results.

About Continued Fraction Calculator

A continued fraction writes x as a₀ + 1/(a₁ + 1/(a₂ + …)) by repeatedly taking the integer part and inverting the remainder. Truncating gives the convergents, which are the best rational approximations for their denominator size.

Formula

Continued fraction

x = a₀ + 1/(a₁ + 1/(a₂ + 1/(a₃ + …)))

Worked example

With the default values below, Continued Fraction Calculator returns Continued fraction terms of [3; 4, 12, 3, 1, 247777268231]. Change any input above and every figure here is recalculated in your browser.

Inputs used

Value to expand
3.245
Number of termsaccepts 1–20
6

Results

Continued fraction terms
[3; 4, 12, 3, 1, 247777268231]
Best rational convergent
160807447082409/49555453646351
Value of the convergent
3.2450000000
Absolute error
0.000000000000

Step by step

  1. 1Values used
  2. 2Continued fraction
  3. 3Continued fraction terms= [3; 4, 12, 3, 1, 247777268231]
  4. 4Best rational convergent= 160807447082409/49555453646351
  5. 5Value of the convergent= 3.2450000000
  6. 6Absolute error= 0.000000000000

Assumptions and limits

  • The result is derived only from the 2 inputs listed above. Anything not among them is not part of the calculation.
  • In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
  • Figures are rounded for display to 12 decimal places, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.

How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.

Frequently Asked Questions

What is the continued fraction of π?

[3; 7, 15, 1, 292, …], whose second convergent 22/7 is the familiar approximation.

Why are convergents optimal?

By the theory of best approximation, no fraction with a smaller denominator comes closer to x than the corresponding convergent.

Continued Fraction Calculator | Calcrivo