Maths & numbers

Continued fractions & convergents

Inspect rational convergents of a supplied decimal number.

Continued fractions & convergents
Esc to restore

Your inputs

Results update as you type. Larger files run when you press Update result.

Your result

LOCAL & PRIVATE

Your result will appear here.

Your inputs stay in this browser. Nothing is uploaded or saved.

A clear answer. Here’s how.

Repeatedly takes the floor and reciprocal fractional part, building exact BigInt numerators and denominators for each convergent. Supports negative values using floor-based coefficients. Stops at a fractional remainder below 10⁻¹⁴ or 30 terms and rejects coefficients outside the safe integer range. The source is a floating-point decimal; late convergents may describe rounding rather than a symbolic irrational.

See a worked example

Worked example

A fixed demonstration, separate from the values you enter above.

Decimal value
3.141592653589793
Maximum terms
10

Example result

First 5 rows of the example result
TermCoefficientNumeratorDenominatorApproximationAbsolute difference
133130.14159265359
272273.142857142860.00126448926735
3153331063.141509433960.0000832196275291
413551133.141592920350.000000266764189405
5292103993331023.141592653010.000000000577890624243

Continued fractions describe the supplied floating-point number, not an exact symbolic irrational. Later convergents may reflect rounding.