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

Haskell help

Name: Anonymous 2010-05-05 18:52

here's a program I wrote...can anyone tell me what I'm doing wrong? inb4 use <insert fave language>

roots :: (Float, Float, Float) -> (Float, Float)
roots (a,b,c) = (x1, x2) where
  x1 = e + (sqrt d) / (2 * a)
  x2 = e - (sqrt d) / (2 * a)
  d = (b * b) - (4 * a * c)
  e = - b / (2 * a)
main :: IO Float -> IO
main = do{
           print "a = "; a <- readLn;
           print "b = "; b <- readLn;
           print "c = "; c <- readLn;
           ans <- roots (a,b,c); print ans;
         }

Name: Anonymous 2010-05-05 19:07

>>2
Thanks, dipshit.

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