diff --git a/chapter2.lisp b/chapter2.lisp index 6a76738..f2bc972 100644 --- a/chapter2.lisp +++ b/chapter2.lisp @@ -90,3 +90,10 @@ (make-interval (- (lower-bound b) (lower-bound a)) (- (upper-bound b) (upper-bound a)))) +;; Exercise 2.9 +(defun width-interval (x) + "Calculate width of an interval as half of the distance between lower +and upper bound." + (/ (- (upper-bound x) (lower-bound x)) + 2.0)) +