A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-list/2001-April/088343.html below:

a little help with my program?

a little help with my program? a little help with my program?Terry Reedy tjreedy at udel.edu
Tue Apr 3 13:40:47 EDT 2001
> import math
...
> x.real = -(b) + pow(b**2 - 4(a)(c)) / 2

If the discriminant (b**2-4.0*a*c)/2 is >=0, you can replace pow with
math.sqrt.
If negative, you must use cmath.sqrt.

However, for serious quadratic root finding, the above formula is NOT the
one to use for actual computation.  A fairly standard alternative is given
in many numerical analysis books, with explanation.




More information about the Python-list mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4