Open derzhavin3016 opened 2 years ago
https://github.com/IShatrov/Quadratic-Equation-Solver/blob/c1f2bdf52e6d4e7e3d05b1fd920b4025e129fd08/quadratic_equation_solver/main.cpp#L81-L99
I think you can add here two cases:
a != 0 && b == 0
x = +- sqrt(c)
c
a != 0 && c == 0
x_1 = 0, x_2 = -b / a
https://github.com/IShatrov/Quadratic-Equation-Solver/blob/c1f2bdf52e6d4e7e3d05b1fd920b4025e129fd08/quadratic_equation_solver/main.cpp#L81-L99
I think you can add here two cases:
a != 0 && b == 0
=>x = +- sqrt(c)
(ifc
is not negative)a != 0 && c == 0
=>x_1 = 0, x_2 = -b / a
(zero root + linear equation)