cfdisrep SciMax Toolbox cflength

SciMax Toolbox >> cfexpand

cfexpand

Maxima Function

Calling Sequence

cfexpand (x)

Description

Returns a matrix of the numerators and denominators of the last (column 1) and next-to-last (column 2) convergents of the continued fraction x.

(%i1) cf (rat (ev (%pi, numer)));
`rat' replaced 3.141592653589793 by 103993/33102 =3.141592653011902
(%o1)                  [3, 7, 15, 1, 292]
(%i2) cfexpand (%);
                         [ 103993  355 ]
(%o2)                    [             ]
                         [ 33102   113 ]
(%i3) %[1,1]/%[2,1], numer;
(%o3)                   3.141592653011902
cfdisrep SciMax Toolbox cflength