LuckyKoala / TwodamBlogGittalk

For comments on twodam.net
0 stars 0 forks source link

Scheme实现求Pi公式 | 笨熊之家 #50

Open LuckyKoala opened 5 years ago

LuckyKoala commented 5 years ago

https://twodam.net/evaluate-PI-in-Scheme

123456789101112(define (sum term a next b) (if (> a b) 0 (+ (term a) (sum term (next a) next b))))(define (pi-sum a b) (define (pi-term x) (/ 1.0 (* x (+ x 2)))) (define (pi