This quadratic equation solver is able to solve any quadratic equation of the form X^2 - P*X + Q = 0
, with P
and Q
rational numbers.
$ python quadratic/solver.py
*************************
Solving X^2 - P*X + Q = 0
*************************
Enter the value of P: 5
Enter the value of Q: 6
Roots: 5/2 - sqrt(1/4), 5/2 + sqrt(1/4)
$ python quadratic/solver.py
*************************
Solving X^2 - P*X + Q = 0
*************************
Enter the value of P: 5
Enter the value of Q: 10
Roots: 5/2 - sqrt(-15/4), 5/2 + sqrt(-15/4)
$ python quadratic/solver.py
*************************
Solving X^2 - P*X + Q = 0
*************************
Enter the value of P: 2
Enter the value of Q: 8/9
Roots: 1 - sqrt(1/9), 1 + sqrt(1/9)
$ python quadratic/solver.py
*************************
Solving X^2 - P*X + Q = 0
*************************
Enter the value of P: 1.23
Enter the value of Q: -0.12
Roots: 123/200 - sqrt(19929/40000), 123/200 + sqrt(19929/40000)