代码大全

(singke) #1
C

/ Compute root of a quadratic equation
This assumes that ( b^2 - 4
a c ) is positive. /


Temp = sqrt ( b^ 2 - 4 a c );
root[0] = ( -b + Temp )/( 2 a );
root[1] = ( -b – Temp )/( 2
a );
sqrt ( b^2 - 4 a c )
TEMP


/ Compute roots of a quadratic equation.
This assumes that ( b^2 – 4
a c )is positive /


Discriminant = sqrt ( b^2 - 4 * a *c );
root[0] = ( -b + Discriminant )/( 2 * a );
root[1] = ( -b - Discriminant )/( 2 * a );

9.2.4

Done Done
Done False Done
True
Error Error Error False


True
Found Found
False Found
True
Success Success Success
False Success True
Success


Processingcomplete Success Found

Free download pdf