diff --git a/chapter2.lisp b/chapter2.lisp index 1c8cce4..6a76738 100644 --- a/chapter2.lisp +++ b/chapter2.lisp @@ -85,3 +85,8 @@ (make-interval (/ 1.0 (upper-bound b)) (/ 1.0 (lower-bound b))))) +;; Exercise 2.8 +(defun sub-interval (a b) + (make-interval (- (lower-bound b) (lower-bound a)) + (- (upper-bound b) (upper-bound a)))) +