Details |
Last modification |
View Log
| RSS feed
| Rev |
Author |
Line No. |
Line |
| 63 |
irasnyd |
1 |
;Written By: Ira Snyder
|
|
|
2 |
;Date: 01-13-2005
|
|
|
3 |
;Project #: Hw 01
|
|
|
4 |
|
|
|
5 |
;define the QUAD1 funtion which returns the "positive" root
|
|
|
6 |
;
|
|
|
7 |
;in infix, this is
|
|
|
8 |
;-b +- sqrt( -b^2 - 4*a*c )
|
|
|
9 |
|
|
|
10 |
(defun QUAD1 (A B C)
|
|
|
11 |
(/
|
|
|
12 |
(+ (- B) (sqrt (- (* B B) (* 4 A C))))
|
|
|
13 |
(* 2 A)
|
|
|
14 |
)
|
|
|
15 |
)
|
|
|
16 |
|
|
|
17 |
;(QUAD1 1 2 1) ;commented since I will run this during a script session
|
|
|
18 |
;(QUAD1 1 -2 1) ;commented since I will run this during a script session
|
|
|
19 |
;(QUAD1 1 -2 -3) ;commented since I will run this during a script session
|
|
|
20 |
|