Page 1 of 1

PHP NEWBIE HELP NEEDED

Posted: Thu Feb 23, 2012 4:33 am
by wagaduku
Greetings friends. Can somebody out there help me with simple code to calculate this problem below using php and a form input from a browser.

Any equation of the form ax2 + bx + c = 0 where a ≠ 0 is called a quadratic equation. And a, b and c are real numbers.
We normally use the formula:

to find the roots of the quadratic equation. However, not all quadratic equations will have roots.
The Discriminant, D is used to determine the nature of the roots.
D = b2 – 4ac
If D > 0 then the quadratic equation has two distinct real roots.
If D = 0 then the quadratic equation has one real root, x = -b/2a.
And if D < 0 then the quadratic equation has no real roots. In fact, it has complex roots.
Further if a = 0 and b ≠ 0 and c ≠ 0 then x = - b/c and if a = b = c = 0 then the quadratic equation has an infinite number of roots.


Thanks in advance

Re: PHP NEWBIE HELP NEEDED

Posted: Thu Feb 23, 2012 5:41 am
by Celauran
What have you written so far? Where are you encountering problems?