Continued fraction/Arithmetic/G(matrix ng, continued fraction n1, continued fraction n2): Difference between revisions
Continued fraction/Arithmetic/G(matrix ng, continued fraction n1, continued fraction n2) (view source)
Revision as of 23:50, 9 March 2023
, 1 year ago→{{header|Scheme}}
Line 4,156:
(define ng ng8)
(define xsource (lambda (i) (cf-ref x i)))
(define ysource (lambda (i) (cf-ref y i)))
(define ix 0)
(define iy 0)
Line 4,199:
(define-values (a12 a1 a2 a b12 b1 b2 b)
(apply values ng))
(define term (
(set! ix (+ ix 1))
(if term
Line 4,213:
;; Replace the x source with one that returns no
;; terms.
(set! xsource (lambda
(set! ng (list a12 a1 a12 a1 b12 b1 b12 b1)))))
(set! ng (list a12 a1 a12 a1 b12 b1 b12 b1)))
Line 4,221:
(define-values (a12 a1 a2 a b12 b1 b2 b)
(apply values ng))
(define term (
(set! iy (+ iy 1))
(if term
Line 4,233:
;; Replace the y source with one that returns no
;; terms.
(set! ysource (lambda
(set! ng (list a12 a12 a2 a2 b12 b12 b2 b2)))))
(set! ng (list a12 a12 a2 a2 b12 b12 b2 b2)))
|