练习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.youkuaiyun.com/nomasp
版权声明:本文为 NoMasp柯于旺 原创文章,未经许可严禁转载!欢迎访问我的博客:http://blog.youkuaiyun.com/nomasp
本文探讨了使用交错级数1-1/2+1/3-1/4+...来计算自然对数2的三种序列逼近方法,通过定义流(stream)和部分和(partial sums)的过程,展示了级数收敛的速度。
951

被折叠的 条评论
为什么被折叠?



