fix error in stop_errors and add debug term output
This commit is contained in:
@@ -116,7 +116,7 @@ int main(int ac, char **av)
|
||||
ft_putchar('\n'); // debug
|
||||
// END tmp debug output
|
||||
|
||||
terms_count_prediction = count_any_of(input, "-+=") + 1; // +1 for first term that can have no leading '+'
|
||||
terms_count_prediction = count_any_of(input, "-+=") + 2; // +1 for first term that can have no leading '+', +1 for last term == NULL
|
||||
|
||||
ft_putstr("-> terms_count_prediction : "); // debug
|
||||
ft_putnbr(terms_count_prediction); // debug
|
||||
@@ -129,5 +129,37 @@ int main(int ac, char **av)
|
||||
ft_putnbr(term_count); // debug
|
||||
ft_putchar('\n'); // debug
|
||||
|
||||
// tmp debug output
|
||||
ft_putchar('\n'); // debug
|
||||
i = 0;
|
||||
while (terms[i].position != TERM_END)
|
||||
{
|
||||
ft_printf("term %2i :\n", i);
|
||||
|
||||
// position
|
||||
ft_printf(" position : ");
|
||||
if (terms[i].position == TERM_LEFT)
|
||||
ft_printf("%s\n", "TERM_LEFT");
|
||||
if (terms[i].position == TERM_RIGHT)
|
||||
ft_printf("%s\n", "TERM_RIGHT");
|
||||
|
||||
// sign
|
||||
ft_printf(" sign : ");
|
||||
if (terms[i].sign == TERM_PLUS)
|
||||
ft_printf("%s\n", "TERM_PLUS");
|
||||
if (terms[i].sign == TERM_MINUS)
|
||||
ft_printf("%s\n", "TERM_MINUS");
|
||||
|
||||
// coefficient
|
||||
printf(" coefficient : %g\n", terms[i].coefficient);
|
||||
|
||||
// exponent
|
||||
ft_printf(" exponent : %d\n", terms[i].exponent);
|
||||
|
||||
i++;
|
||||
}
|
||||
ft_putchar('\n'); // debug
|
||||
// END tmp debug output
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user