2008/12/18 Scott David Daniels <scott.dani...@acm.org>: > def quadsolve(a, b, c): > try: > discriminant = sqrt(b**2 - 4 * a * c)
The discriminant of a quadratic is more usually just the b**2 - 4 * a * c part, not the square root of it. Testing that for negative, zero or positive avoids the need to use an exception for a normal case. -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list