I was able to get this working at one point but now I don't know whats wrong with it. It will compile but it gives an -1.#nd(or something close) as an answer for x1 and x2. Help please.
//call quadratic formula
a = nums[0];
b = nums[1];
c = nums[2];
x1 = ((-b) + (sqrt((pow(b, 2) - (4 * a * c)))))/(2 * a);
x2 = ((-b) - (sqrt((pow(b, 2) - (4 * a * c)))))/(2 * a);
pow(b, 2) - (4 * a * c) with 1 2 3 is negative. If you want to get a root of a negative, use complex numbers. Otherwise, check this value before calculating roots.