pdpinch
  • pdpinch
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?
MIT 6.189 A Gentle Introduction to Programming Using Python (OCW)
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.

Get our expert's

answer on brainly

SEE EXPERT ANSWER

Get your free account and access expert answers to this
and thousands of other questions.

pdpinch
  • pdpinch
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?
MIT 6.189 A Gentle Introduction to Programming Using Python (OCW)
jamiebookeater
  • jamiebookeater
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.

Get this expert

answer on brainly

SEE EXPERT ANSWER

Get your free account and access expert answers to this
and thousands of other questions

anonymous
  • anonymous
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.

More answers

Looking for something else?

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