fix reducer sign error
This commit is contained in:
@@ -21,7 +21,8 @@ static double get_all_terms_with_exponent(s_term *terms, int exponent)
|
||||
// sign
|
||||
sign = 1;
|
||||
if (terms[i].position == TERM_RIGHT)
|
||||
sign = terms[i].sign == TERM_PLUS ? -1 : 1;
|
||||
sign = -1;
|
||||
// sign = terms[i].sign == TERM_PLUS ? -1 : 1;
|
||||
|
||||
// add coefficients
|
||||
coefficient += terms[i].coefficient * sign;
|
||||
|
||||
@@ -14,7 +14,7 @@ static void solve_degree_1(s_solution_degree_1 *solution, double a, double b)
|
||||
solution->a = a;
|
||||
solution->b = b;
|
||||
|
||||
solution->solution = positiv_zero(-b / a); // -b / a
|
||||
solution->solution = positiv_zero(-b / a);
|
||||
}
|
||||
|
||||
static void solve_degree_2(s_solution_degree_2 *solution, double a, double b, double c)
|
||||
|
||||
Reference in New Issue
Block a user