Sponsored links: Algebra eBooks ### The Maxima on-line user's manual

Algebra Calculator

#### Search: #### Cfexpand

Function: cfexpand (<x>) 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`

```(%o1)                                true
(%i2) ```

### Related Examples

##### cfexpand-sqrt

cfexpand(cf(sqrt(2)));

Calculate

##### cfexpand-sqrt

cfexpand(cf(sqrt(2)));

Calculate

? cfexpand;

Calculate

? cfexpand;

Calculate

##### cfexpand-cflength-flength-sqrt

cflength: 8;

cfexpand(cf(sqrt(2)));

Calculate

##### cfexpand-cflength-flength-sqrt

cflength: 10;

cfexpand(cf(sqrt(2)));

Calculate

##### cfexpand-sqrt

cfexpand(cf(sqrt(2)));

Calculate

? cfexpand;

Calculate

? cfexpand;

Calculate

##### cfexpand-cflength-flength-sqrt

cflength: 5;

cfexpand(cf(sqrt(2)));

Calculate 