【SICP练习】134 练习3.65

练习3-65

原文

Exercise 3.65. Use the series
ln2 = 1- 1/2 + 1/3 - 1/4 + ……
to compute three sequences of approximations to the natural logarithm of 2, in the same way we did above for . How rapidly do these sequences converge?

代码

(define (ln2-summands n)
        (cons-stream (/ 1.0 n) 
                     (stream-map - (ln2-summands (+ n 1)))))
(define ln2-stream
        (partial-sums (ln2-summands 1)))



感谢访问,希望对您有所帮助。 欢迎关注或收藏、评论或点赞。


为使本文得到斧正和提问,转载请注明出处:
http://blog.csdn.net/nomasp


版权声明:本文为 NoMasp柯于旺 原创文章,如需转载请联系本人。

原文地址:https://www.cnblogs.com/NoMasp/p/4786066.html