On Dec 18, 11:52 am, eric <e...@ericaro.net> wrote: > On Dec 18, 8:37 pm, collin.da...@gmail.com wrote: > > > I am trying to write a simple application to factor polynomials. I > > wrote (simple) raw_input lines to collect the a, b, and c values from > > the user, but I dont know how to implement the quadratic equation > > > x = (-b +or- (b^2 - 4ac)^1/2) / 2a > > > into python. Any ideas? > > with numpy: > from numpy import * > > s=[1,-1] > x = -b+s*sqrt( b**2-4*a*c )/(2*a) > > Erichttp://codeslash.blogspot.com
Ahh. Great.. thank you. I didnt know about the sqrt function.. saves me from doing "^1/2". Thanks again. -CD -- http://mail.python.org/mailman/listinfo/python-list