Go back to Richel Bilderbeek's homepage.
Go back to Richel Bilderbeek's Texas Code Snippets.
A program to calculate and interpret the results of a quadratic equation.
A quadratic equation can be written in the form below.
a.x2 + b.x + c = 0
First the discrimant must be calculated:
D = b2 - 4.a.c
If the discriminant is below zero, the equation has no solution.
If the discriminant is zero, the equation has a single solution. The solution will be equal to the formula below:
x = (-b) / (2.a)
If the discriminant is above zero, the equation has two solutions. The solutions can be calcultaed by the formulas below:
x1 = (-b + √(D) ) / (2.a)
x2 = (-b - √(D) ) / (2.a)
The code in the Texas TI-84 might look like this:
: ClrHome |
Go back to Richel Bilderbeek's C++ page.
Go back to Richel Bilderbeek's homepage.
This page has been created by the tool CodeToHtml