Sponsored links: Algebra eBooks
 

Related

cfexpand-cflength-flength-sqrt

cflength: 5;

cfexpand(cf(sqrt(2)));

Calculate

cfexpand-sqrt

cfexpand(cf(sqrt(2)));

Calculate

cfexpand-sqrt

cfexpand(cf(sqrt(2)));

Calculate

cfexpand-cflength-flength-sqrt

cflength: 10;

cfexpand(cf(sqrt(2)));

Calculate

cfexpand-cflength-flength-sqrt

cflength: 10;

cfexpand(cf(sqrt(2)));

Calculate

cfexpand-cflength-flength-sqrt

cflength: 8;

cfexpand(cf(sqrt(2)));

Calculate

cfexpand-cflength-flength-sqrt

cflength: 7;

cfexpand(cf(sqrt(2)));

Calculate

cfexpand-sqrt

cfexpand(cf(sqrt(2)));

Calculate

cfexpand

Run Example
(%i1)cfexpand(cf(sqrt(2)));
                                   [ 3  1 ]
(%o1)                              [      ]
                                   [ 2  1 ]
(%i2) 
Run Example
? 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) 
Run Example
cflength: 10;
(%o1)                                 10
(%i2) cfexpand(cf(sqrt(2)));
                                [ 8119  3363 ]
(%o2)                           [            ]
                                [ 5741  2378 ]
(%i3) 

Related Help

Help for Cfexpand