Blob


1 ;; The first three lines of this file were inserted by DrScheme. They record metadata
2 ;; about the language level of this file in a form that our tools can easily process.
3 #reader(lib "htdp-beginner-reader.ss" "lang")((modname 4.4.4) (read-case-sensitive #t) (teachpacks ((lib "convert.ss" "teachpack" "htdp"))) (htdp-settings #8(#t constructor repeating-decimal #f #t none #f ((lib "convert.ss" "teachpack" "htdp")))))
4 ;; how-many : number number number -> number
5 ;; Determines how many solutions a given quadratic equation has given
6 ;; coefficients a, b, and c.
8 (define (how-many a b c)
9 (cond
10 [(= a 0) 'degenerate]
11 [(> (sqr b) (* 4 a c)) 2]
12 [(= (sqr b) (* 4 a c)) 1]
13 [(< (sqr b) (* 4 a c)) 0]))