![]() |
Python
1.0
|
Solving second degree equations. More...
Functions | |
def | eqn2 (a, b, c) |
Solves a second degree equation: \(ax²+bx+c=0\). More... | |
def | main () |
Solving second degree equations.
Having \(ax^2+bx+c=0,\) the roots are given by the quadratic formula
\[x=\frac{-b \pm \sqrt {b^2-4ac}}{2a},\]
where the symbol "±" indicates that both \(x=\frac{-b + \sqrt {b^2-4ac}}{2a}\quad\text{and}\quad x=\frac{-b - \sqrt {b^2-4ac}}{2a}\) are solutions of the quadratic equation.
def _01b_eqn2.eqn2 | ( | a, | |
b, | |||
c | |||
) |
Solves a second degree equation: \(ax²+bx+c=0\).
a | a coefficient. |
b | b coefficient. |
c | c coefficient. |
Referenced by main().
def _01b_eqn2.main | ( | ) |
References eqn2(), and _01d_dec2bin.input.