diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pile.c | 7 | ||||
-rw-r--r-- | lib/polynom.c | 2 |
2 files changed, 5 insertions, 4 deletions
@@ -36,6 +36,7 @@ void push_pile(char *st) d_number = char_to_double(st, &valid2); valid3 = is_mute(st); poly = (polynome) NomVarToVar(st, variables, &valid4); + printf("%p\n", poly); if (valid1) { /* il s agit d un entier */ pushcontext("c est un entier"); push_pile_poly(ply_constr(rat_constr(i_number, 1), 0)); @@ -123,14 +124,14 @@ pile_elem pop_pile(unsigned int count) sprintf(buf, _("pop_pile: Can't pop %u elements"), count); exception(1, buf); } + fprintf(stderr,"pile_ptr = %d\n", pile_ptr); return pile[pile_ptr]; } char *affichage_level_1(void) { char *result=NULL; - - if (!pile_ptr) { + if (pile_ptr) { switch (pile[pile_ptr - 1].type) { case T_POLY: result = ply_affichage(pile[pile_ptr - 1].poly); @@ -257,7 +258,7 @@ void act_pile(int func) InsererVarDansTab(&variables, CreerElement(operande2.label, (void *) operande1.poly)); - free(operande2.label); + /* free(operande2.label); */ } else { exception(1, _("act_pile: OP_ASSIGN empty string")); } diff --git a/lib/polynom.c b/lib/polynom.c index 72f02bf..7747ec6 100644 --- a/lib/polynom.c +++ b/lib/polynom.c @@ -257,7 +257,7 @@ double ply_valuation(polynome poly, double point) while (poly) { result += rat_to_double(poly->coef) * pow(point, (double) (poly->degre)); - poly++; + poly=poly->suiv; } return result; } |