[SICP 연습] 131 연습 3.62.

연습 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.csdn.net/nomasp
판권 성명: 본 논문은 NoMaspco 우왕의 오리지널 문장으로 허가 없이 전재를 엄금합니다!내 블로그에 오신 것을 환영합니다.http://blog.csdn.net/nomasp

좋은 웹페이지 즐겨찾기