(wat-aro)

無職から有職者にランクアップしました

SICP 問題 2.12

(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 (make-center-percent c p)
  (make-interval c (* c (/ w 100))))

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