In addittion to the two errors others have pointed out, note that the correct formula is
-($b + (0 < $b ? 1 : -1) * sqrt($b*$b - 4*$a * $c)) / 2*$a
In reply to Re: solving a quadratic equation
by ambrus
in thread solving a quadratic equation
by vis1982
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |