Euclidean quotients
355 = 3 × 113 + 16
113 = 7 × 16 + 1
16 = 16 × 1 + 0
The quotients are 3, 7, and 16, giving [3; 7, 16].
Examples: 43/30, -2.75, or 1.25e-4. Up to 300 significant digits and an exponent from −1,000 to 1,000.
With 355/113, select Calculate to see [3; 7, 16] and all three convergents.
A simple continued fraction writes a number using an integer part and reciprocals of positive integers. The compact notation [a₀; a₁, a₂, …] means:
a₀ + 1/(a₁ + 1/(a₂ + 1/(…)))
For a rational input, repeated Euclidean division eventually reaches remainder zero, so the expansion is finite. This tool uses the canonical finite form: the final term is greater than 1 unless the value is an integer.
For negative values, a0 is the mathematical floor. For example, −22/7 = [−4; 1, 6], with every term after the first remaining positive.
Convergent recurrence
p₋₂ = 0, p₋₁ = 1
q₋₂ = 1, q₋₁ = 0
pₖ = aₖpₖ₋₁ + pₖ₋₂
qₖ = aₖqₖ₋₁ + qₖ₋₂
The kth convergent is pₖ/qₖ. All calculations use exact BigInt integer arithmetic rather than binary floating point.
355 = 3 × 113 + 16
113 = 7 × 16 + 1
16 = 16 × 1 + 0
The quotients are 3, 7, and 16, giving [3; 7, 16].
3/1, 22/7, 355/113
Each added term refines the fraction. With a maximum denominator of 100, the closest allowed result is 311/99; intermediate fractions can beat the last full convergent when the limit falls between convergent denominators.
| Input | Exact value used |
|---|---|
| 43/30 | The entered numerator divided by the entered nonzero denominator, reduced exactly. |
| 0.125 | The finite decimal 125/1000 = 1/8, not an approximate binary floating-point value. |
| 1.25e-4 | The exact decimal 0.000125 = 1/8000. |
| Decimal digits of π or √2 | The finite digits entered. The tool does not infer a named irrational constant. |
Limits: 300 significant digits; scientific exponent from −1,000 to 1,000; maximum denominator from 1 to 1,000,000,000,000; and at most 200 displayed terms. If an exact expansion is longer than the display limit, the approximation still uses the complete input value.
A convergent is the exact fraction obtained by stopping at a term of the continued fraction. Its numerator and denominator come from the recurrence above.
Not always. When a limit lies between two convergent denominators, an intermediate (semiconvergent) fraction may be closer. The bounded-denominator result checks the relevant boundary candidate as well as the last eligible convergent.
No. Irrational numbers have infinite non-repeating continued fractions and cannot be supplied exactly as a finite decimal. Example buttons use finite decimal approximations and clearly treat those digits as the exact input.
If the last term is greater than 1, it can be replaced by one less followed by 1. For example, [3; 7, 16] = [3; 7, 15, 1]. This tool returns the shorter canonical form ending above 1.
The first term is the floor of the value, not truncation toward zero. Later terms are positive, so the output remains a standard simple continued fraction.
No. The decimal text is converted directly into a ratio of integers and simplified. Approximate decimal previews are for readability; fractions and error ratios are exact.
Yes. Parsing, continued-fraction expansion, and rational comparison happen locally in your browser. Inputs are not uploaded, stored, or added to the page URL.