Subversion Repositories programming

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
63 irasnyd 1
irasnyd@duallie lisp $ script hw01.script
2
Script started, file is hw01.script
3
irasnyd@duallie lisp $ cat hw01.lisp
4
;Written By: Ira Snyder
5
;Date:       01-13-2005
6
;Project #:  Hw 01
7
 
8
;define the QUAD1 funtion which returns the "positive" root
9
;
10
;in infix, this is
11
;-b +- sqrt( -b^2 - 4*a*c )
12
 
13
(defun QUAD1 (A B C) 
14
  (/ 
15
    (+ (- B) (sqrt (- (* B B) (* 4 A C)))) 
16
    (* 2 A)
17
  ) 
18
)
19
 
20
;(QUAD1 1 2 1)          ;commented since I will run this during a script session
21
;(QUAD1 1 -2 1)         ;commented since I will run this during a script session
22
;(QUAD1 1 -2 -3)        ;commented since I will run this during a script session
23
 
24
irasnyd@duallie lisp $ clisp -q
25
 
26
[1]> (load 'hw01.lisp)
27
;; Loading file hw01.lisp ...
28
;; Loaded file hw01.lisp
29
T
30
[2]> (QUAD1 1 2 1)
31
-1
32
[3]> (QUAD1 1 -2 1)
33
1
34
[4]> (QUAD1 1 -2 -3)
35
3
36
[5]> (quit)
37
irasnyd@duallie lisp $ exit
38
Script done, file is hw01.script