Snappy apps: Don't request sbcl on exotic architectures
[maxima/cygwin.git] / demo / cf.dem
blobd3580ac7473f1ff629a496aa4c050f4a5b3b736b
1 /* ===================================================================== */
2 /* file: cf.dem    */
3 /* CONTINUED FRACTIONS. THIS IS GOOD STUFF. */
5 frac1:cf([1,2,3,4]);
6 frac2:cf([2,3,4,5]);
7 cfdisrep(frac1);
8 cf(frac1+frac2);
9 cfdisrep(%);
12 cf(467288576/469097433);
13 cfdisrep(%);
14 ratsimp(%);
17 /* cf can make the continued fraction expansion of sqrt(n) to
18    cflength terms. */
20 block([cflength:4],cfdisrep(cf(sqrt(3))));
21 ratsimp(%);
22 %^2-3;
24 ratsqrt(n,cflength):=ratsimp(cfdisrep(cf(sqrt(n))))$
26 ratsqrt(1776,25);
27 %^2-1776;
29 /* With the primitives of SQRT and rational operations 
30    continued fraction expansions of many trancendental expressions
31    may be made in the classical way. */
33 /* ======================== END ==== END  ====================== */