Quick actions

cmd+k|ctrl+k

Navigation

Languages

poly

Snippet info

Language

Haskell

Visibility

public

Author

danielmg17

Created

2017-10-28T02:58:58Z

Updated

2017-11-08T18:56:31Z

roots :: (Float, Float, Float) -> (Float, Float)  
roots (0,b,c) = (x,x) where
    x = (-c)/b
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 = do 
   putStrLn "The roots of our Polynomial equations are:" 
   print (roots(1,1,0))
   print (roots(0,1,1))
INFO