Subversion Repositories programming

Rev

Rev 100 | Blame | Compare with Previous | Last modification | View Log | RSS feed

;Written By: Ira Snyder
;Date:       01-13-2005
;Project #:  Hw 01
;License: Public Domain

;define the QUAD1 funtion which returns the "positive" root
;
;in infix, this is
;-b +- sqrt( -b^2 - 4*a*c )

(defun QUAD1 (A B C) 
  (/ 
    (+ (- B) (sqrt (- (* B B) (* 4 A C)))) 
    (* 2 A)
  ) 
)

;(QUAD1 1 2 1)          ;commented since I will run this during a script session
;(QUAD1 1 -2 1)         ;commented since I will run this during a script session
;(QUAD1 1 -2 -3)        ;commented since I will run this during a script session