fix coefficient sign error
This commit is contained in:
@@ -19,9 +19,9 @@ static double get_all_terms_with_exponent(s_term *terms, int exponent)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// sign
|
// sign
|
||||||
sign = terms[i].sign == TERM_PLUS ? 1 : -1;
|
sign = 1;
|
||||||
if (terms[i].position == TERM_RIGHT)
|
if (terms[i].position == TERM_RIGHT)
|
||||||
sign *= -1;
|
sign = terms[i].sign == TERM_PLUS ? -1 : 1;
|
||||||
|
|
||||||
// add coefficients
|
// add coefficients
|
||||||
coefficient += terms[i].coefficient * sign;
|
coefficient += terms[i].coefficient * sign;
|
||||||
|
|||||||
Reference in New Issue
Block a user