summaryrefslogtreecommitdiff
path: root/coding-exercises/2/10.rkt
blob: 20c70b015014215056f7b6df60bcd67389c69b0d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#lang racket
(require 
  "7.rkt"
  "8.rkt"
  "9.rkt")

(define (div-interval x y)
  (if (and (< 0 (lower-bound y)) (> 0 (upper-bound y)))
    (error "Division by interval spanning zero")
    (mul-interval 
      x
      (make-interval 
        (/ 1.0 (upper-bound y))
        (/ 1.0 (lower-bound y))))))