Skip to main content

Module continued_fractions

Module continued_fractions 

Source
Expand description

Continued fractions: representation, convergents, and visualization.

Structs§

ContinuedFraction
A continued fraction [a0; a1, a2, …] representing a0 + 1/(a1 + 1/(a2 + …)).
ConvergentGlyph
ConvergentVisualizer
Render convergents as points on a number line converging to a target value.

Functions§

sqrt_cf
Compute the periodic continued fraction for sqrt(n), where n is not a perfect square. Returns a ContinuedFraction where coefficients form the repeating period.