continued_fraction, a Fortran90 code which implements some simple algorithms for dealing with simple and generalized continued fractions.
Mathematically, continued fractions are infinite sums. In general, they are treated computationally as finite sums. Here we will assume that all such sums terminate at index N.
A simple continued fraction (SCF) is a representation of a number R as:
R = A0 + 1 / ( A1 + 1 / ( A2 + 1 / ( A3 + ... + 1 / AN )...)))
A generalized continued fraction (GCF) is a representation of a number R as:
R = A0 + B1 / ( A1 + B2 / ( A2 + B3 / ( A3 + ... + BN / AN )...)))
For either form of continued fraction, there are two tasks:
The information on this web page is distributed under the MIT license.
continued_fraction is available in a C version and a C++ version and a Fortran90 version and a MATLAB version and an Octave version and a Python version.
subset, a Fortran90 code which enumerates, generates, randomizes, ranks and unranks combinatorial objects including combinations, compositions, Gray codes, index sets, partitions, permutations, polynomials, subsets, and Young tables. Backtracking routines are included to solve some combinatorial problems. Some routines for continued fractions are included.