; continued fraction (cons (lambda (x n) (let* ((fl (lambda (z) (inexact->exact (floor z))))(y (fl x))) (cons y (let cf ((x (- x y))(n n)) (if (or (= n 0) (= x 0)) () (let* ((z (/ x)) (i (inexact->exact (floor z)))) (cons i (cf (- z i) (- n 1))))))))) (lambda (x) (let r ((x x)) (if (null? x) 0 (+ (car x) (let ((c (r (cdr x)))) (if (= c 0) 0 (/ c)))))))) ((car (fileVal "ContFrac")) (* 4 (atan 1)) 10) ; => (3 7 15 1 292 1 1 1 2 1 3) (+ 0. ((cdr (fileVal "ContFrac")) '(3 7 15 1 292 1 1 1 2 1 3))) ; => 3.141592653589389