(define (tan-cf x k)
(define (d i) (- (* 2.0 i) 1.0))
(define (n i)
(if (= i 1) x (* x x)))
(define (iter i result)
(if (= i 0)
result
(iter (- i 1) (/ (n i) (- (d i) result)))))
(iter k 0))
(newline)
(display (tan-cf 1 100))
(newline)
(display (tan 1))
SICP 练习1.39 计算tan(x)
最新推荐文章于 2019-08-02 08:23:53 发布