练习3-62
原文
Exercise 3.62. Use the results of exercises 3.60 and 3.61 to define a procedure div-series that divides two power series. Div-series should work for any two series, provided that the denominator series begins with a nonzero constant term. (If the denominator has a zero constant term, then div-series should signal an error.) Show how to use div-series together with the result of exercise 3.59 to generate the power series for tangent.
代码
(define (div-series s1 s2) (let ((c (stream-car s2))) (if (= c 0) (error "constant term of s2 can't be 0!") (scale-stream (mul-series s1 (reciprocal-series (scale-stream s2 (/ 1 c)))) (/ 1 c)))))
(define tane-series (div-series sine-series cosine-series))
感谢访问,希望对您有所帮助。 欢迎关注或收藏、评论或点赞。
为使本文得到斧正和提问,转载请注明出处:
http://blog.youkuaiyun.com/nomasp
版权声明:本文为 NoMasp柯于旺 原创文章,未经许可严禁转载!欢迎访问我的博客:http://blog.youkuaiyun.com/nomasp
本文介绍了一个名为div-series的过程定义,该过程用于两个幂级数的除法运算,前提条件是分母级数必须以非零常数项开始。通过使用此过程与先前练习的结果,我们展示了如何生成正切的幂级数。代码示例中包括了如何通过sine-series和cosine-series生成tane-series。
312

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



