Continued fraction library
C Perl
Failed to load latest commit information.
man
t
.gitignore
Makefile
README add README Feb 24, 2010
between.c note that "between" utility is unimplemented Oct 20, 2013
cf-evaluate missing declarations and other cleanups Feb 23, 2010
cf.c INFINITY seems to have problems compiling under darwin; it's probably Feb 1, 2005
cf.h INFINITY seems to have problems compiling under darwin; it's probably Feb 1, 2005
cf_append.c missing declarations and other cleanups Feb 24, 2010
cf_append.h cf_append: Mar 17, 2007
cf_arith.c
cf_arith.h Initial revision Feb 1, 2005
cf_between.c
cf_between.h cf_append: Mar 17, 2007
cf_float.c INFINITY seems to have problems compiling under darwin; it's probably Feb 1, 2005
cf_float.h Initial revision Feb 1, 2005
cf_holo.c missing declarations and other cleanups Feb 24, 2010
cf_holo.h Added cf_it for CFs whose terms are calculated as f(0), f(1), f(2), .… Feb 1, 2005
cf_it.c *** empty log message *** May 3, 2005
cf_it.h Added cf_it for CFs whose terms are calculated as f(0), f(1), f(2), .… Feb 1, 2005
cf_per.c cf_append: Mar 17, 2007
cf_per.h cf_append: Mar 17, 2007
cf_rat.c INFINITY seems to have problems compiling under darwin; it's probably Feb 1, 2005
cf_rat.h Initial revision Feb 1, 2005
main.c Added cf_it for CFs whose terms are calculated as f(0), f(1), f(2), .… Feb 1, 2005
surd.c eventually-periodic CFs, and a simple test Mar 16, 2007
surd2.c cf_append: Mar 17, 2007

README

This is a small library for continued fraction calculations, written
in C.  For more details about continued fractions and the algorithms
herein, see 

        http://perl.plover.com/yak/cftalk/

The library is documented in "libcf.3".

The Makefile builds a program called "cf-demo" that demonstrates the
library.  This is fully documented in "demo.1".  A brief usage summary
follows.

        cf-demo num den

Print the continued fraction expansion of rational number num/den.
For example, "cf-demo 29 8" prints "3 1 1 1 2".

	cf-demo x

Print the continued fraction expansion of floating point number x.
For example, "cf-demo 1.4142" prints "1 2 2 2 2 2 1 1 29 86 312".

	cf-demo a b c d x

Print the continued fraction expansion of (ax+b)/(cx+d) where
a,b,c,d are integers and x is real.

	cf-demo a b c d e f g h x y


Print the continued fraction expansion of (axy+bx+cy+d)/(exy+fx+gy+h)
where a..h are integers and x and y are real.

	cf-demo x + y
	cf-demo x - y
	cf-demo x * y
	cf-demo x / y

x and y are first converted to continued fractions, and then the
indicated calculation is performed; for example 'x + y' adds x and y.
Then the resulting continued fraction is printed.  For convenience,
'x' is accepted as a synonym for '*'.