C# 实现求解一元二次方程方法 //解一元二次方程方程 public static void GenEqu2(double a, double b, double c, out double res1, out double res2) { double b2 = b * b; double ac4 = 4 * a * c; double M = (float)Math.Sqrt(b2 - ac4); res1 = (-b + M) / (2 * a); res2 = (-b - M) / (2 * a); }