I want to make the quadratic equation in C++ using only a
,b
, and c
as the variables, using mostly parenthesis, but i'm not getting the correct answers.
root1 = ((-1*b) + (std::sqrt((b*b) - (4*a*c)))) / 2*a;
root2 = ((-1*b) - (std::sqrt((b*b) - (4*a*c)))) / 2*a;