Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (define (quad a b c)
- (if (< (- (square b) (* 4 a c)) 0) 'imaginary)
- ;;;Computes positive root, then negative root, and appends it all to the list
- (else (cons (/ (+ (* -1 b) (sqrt (- (square b) (* 4 a c))) (* 2 a)))
- (cons (/ (- (* -1 b) (sqrt (- (square b) (* 4 a c))) (* 2 a))) '())
- ))
- )
Advertisement
Add Comment
Please, Sign In to add comment