Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

My first scheme program

Name: Anonymous 2012-01-17 16:31

Wrote this while bored and waiting for my functional programming class... is it... okay?


(define quad
  (lambda (a b c)
    (define root (- (* b b) (* 4 a c)))
    (if (> root 0)
      (list
        (/ (+ (- b) (sqrt root)) (* 2 a))
        (/ (- (- b) (sqrt root)) (* 2 a)))
      '()
    )))

Name: Anonymous 2012-01-17 16:45

Why not return complex roots, fagstrum?

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List