Hatena::Groupcsnagoya-sicp

toyoshiのSICP宿題帖

 | 

2009-04-11

2.12

| 23:53 | はてなブックマーク - 2.12 - toyoshiのSICP宿題帖

(define (make-center-width c w)
  (make-interval (- c w) (+ c w)))

(define (center i)
  (/ (+ (lower-bound i) (upper-bound i)) 2))

(define (width i)
  (/ (- (upper-bound i) (lower-bound i)) 2))

(define (percent i)
  (* (/ (width i) (center i)) 100))

(define (make-center-percent c p)
  (make-interval (+ c (* c (/ p 100))) (- c (* c (/ p 100)))))
 |