因此,我正试图正确而充分地 j笑这个法典的主体,但我很想知道,什么是做的,什么是做的。 感谢!
public double largerRoot (double a, double b, double c) throws Exception
{
double discriminant;
double root1;
double root2;
discriminant = Math.sqrt ( b * b - 4 * a * c );
if ((discriminant < 0) || (a == 0))
{
throw (new Exception("Math Error"));
}
root1 = (-b + discriminant) / (2 * a);
root2 = (-b - discriminant) / (2 * a);
return Math.max(root1, root2);
}