commments for 6 and 7. 9 works, 8 does not
This commit is contained in:
@ -15,17 +15,17 @@ static float discriminant(){
|
||||
|
||||
void abc(){
|
||||
float D = discriminant();
|
||||
if (D>0){
|
||||
x1real = ((-b+sqrt(D))/(2.0*a));
|
||||
if (D>0){ /*Calculate x1real and x2real if D>0*/
|
||||
x1real = ((-b+sqrt(D))/(2.0*a)); /*Use 2.0 instead of 2 so a float is calculated instead of an int*/
|
||||
x2real = ((-b-sqrt(D))/(2.0*a));
|
||||
ximag = 0;
|
||||
}
|
||||
else if(D<0){
|
||||
else if(D<0){ /*Calculate x1real and ximag if D<0*/
|
||||
x1real = -b/(2.0*a);
|
||||
x2real = x1real;
|
||||
ximag = (sqrt(-D)/(2.0*a));
|
||||
}
|
||||
else{
|
||||
else{ /*Calculate x1real if D=0*/
|
||||
x1real = -b/(2.0*a);
|
||||
x2real = x1real;
|
||||
ximag = 0;
|
||||
|
Reference in New Issue
Block a user