We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
div-series应该求任何两个级数,您的代码只能求分母的常数项是1的情况。 我的代码: ; 假设X= S1 / S2 ; X = S1 * (1 / (S2 / c)) * (1 / c) (c是S2的常数项)
(define (div-series s1 s2) (let ((c (stream-car s2))) (if (= c 0) (error "The series in the denominator has 0! constant terms") (scale-stream (mul-series s1 (reciprocal-series (scale-stream s2 (/ 1 c)))) (/ 1 c)))))
(define tan-series (div-series sine-series cosine-series)) ;(display-top10 tan-series) ;0 1 0 1/3 0 2/15 0 17/315 0
The text was updated successfully, but these errors were encountered:
楼上正解
Sorry, something went wrong.
No branches or pull requests
div-series应该求任何两个级数,您的代码只能求分母的常数项是1的情况。
我的代码:
; 假设X= S1 / S2
; X = S1 * (1 / (S2 / c)) * (1 / c) (c是S2的常数项)
(define (div-series s1 s2)
(let ((c (stream-car s2)))
(if (= c 0)
(error "The series in the denominator has 0! constant terms")
(scale-stream (mul-series s1
(reciprocal-series (scale-stream s2 (/ 1 c))))
(/ 1 c)))))
(define tan-series (div-series sine-series cosine-series))
;(display-top10 tan-series)
;0 1 0 1/3 0 2/15 0 17/315 0
The text was updated successfully, but these errors were encountered: