Subversion Repositories programming

Rev

Rev 100 | Details | Compare with Previous | 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
108 ira 4
;License: Public Domain
63 irasnyd 5
 
6
;define the QUAD1 funtion which returns the "positive" root
7
;
8
;in infix, this is
9
;-b +- sqrt( -b^2 - 4*a*c )
10
 
11
(defun QUAD1 (A B C) 
12
  (/ 
13
    (+ (- B) (sqrt (- (* B B) (* 4 A C)))) 
14
    (* 2 A)
15
  ) 
16
)
17
 
18
;(QUAD1 1 2 1)          ;commented since I will run this during a script session
19
;(QUAD1 1 -2 1)		;commented since I will run this during a script session
20
;(QUAD1 1 -2 -3)	;commented since I will run this during a script session
21