I'm working on Exercise 2.5 in http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-189-a-gentle-introduction-to-programming-using-python-january-iap-2011/assignments/MIT6_189IAP11_hw2.pdf Sadly, my math skills have atrophied. I'm supposed to write a function that computes the roots of a quadratic. I looked it on Wikipedia at http://en.wikipedia.org/wiki/Quadratic_equation#Quadratic_formula But I'm also supposed to check for complex roots. How do I do that? What I have so far at https://gist.github.com/3845296 Also, anyone have test cases with answers?

Hey! We 've verified this expert answer for you, click below to unlock the details :)

I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!

U know the b^2 -4ac bit of the quadratic? If that is less than 0, then the roots are complex.

Looking for something else?

Not the answer you are looking for? Search for more explanations.