From d7bcd52fd0910d8bc9d16798aafb2391b130648f Mon Sep 17 00:00:00 2001 From: Tobias Eidelpes Date: Sat, 5 Nov 2022 12:50:28 +0100 Subject: [PATCH] Add exercise 2.8 --- chapter2.lisp | 5 +++++ 1 file changed, 5 insertions(+) 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)))) +