summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorbiouman <biouman>2001-05-02 03:34:15 +0000
committerbiouman <biouman>2001-05-02 03:34:15 +0000
commita0c6c21ab0d031376cb37b3f2b931a3ceabaa1b7 (patch)
tree2baaf07859197a2bb2f877d764a55db92ee025ac /lib
parent2be0a25ad121a8c431c616866ac99071c04950de (diff)
*** empty log message ***
Diffstat (limited to 'lib')
-rw-r--r--lib/fonctions.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/lib/fonctions.c b/lib/fonctions.c
index f133c98..dee16a8 100644
--- a/lib/fonctions.c
+++ b/lib/fonctions.c
@@ -46,14 +46,14 @@ void appel_fonction(char *nom, int arite, polynome p1, polynome p2, polynome p3)
int i=0;
int trouve = 0;
- while (func_table[i].nom) {
- if( strcmp(func_table[i].nom, nom))
+ while ((func_table[i].nom)&&(!trouve)) {
+ if(!strcmp(func_table[i].nom, nom))
trouve = 1;
i++;
}
if (trouve) {
- if (func_table[i].arite==arite) {
- (*func_table[i].func)(p1, p2, p3);
+ if (func_table[i-1].arite==arite) {
+ (*func_table[i-1].func)(p1, p2, p3);
} else {
exception(1,_("appel_fonction: incorrect arg number"));
}
@@ -64,16 +64,13 @@ void appel_fonction(char *nom, int arite, polynome p1, polynome p2, polynome p3)
}
-
-
-
void deriv(polynome p1, polynome p2, polynome p3)
{
polynome resultat = NULL, temp = NULL, t;
while (p1) {
if (p1->degre) {
- t=ply_constr(rat_constr((p1->coef.num)*(p1->coef.degre), p1->coef.denom), (p1->degre-1));
+ t=ply_constr(rat_constr((p1->coef.num)*(p1->degre), p1->coef.denom), (p1->degre-1));
if (t) {
if (resultat) {
temp->suiv = t;
@@ -98,7 +95,7 @@ void derivn(polynome p1, polynome p2, polynome p3)
push_pile_poly(p2);
for(i=0; i<p1->coef.num; i++) {
temp=pop_pile(1);
- deriv(elemtemp.poly);
+ deriv(temp.poly, NULL, NULL);
}
} else {
exception(1,_("derivn: invalid 2nd arg"));
@@ -114,7 +111,7 @@ void integ(polynome p1, polynome p2, polynome p3)
while (p1) {
- t=ply_constr(rat_constr((p1->coef.num), (p1->coef.denom)*(p1->coef.degre+1)), (p1->degre+1));
+ t=ply_constr(rat_constr((p1->coef.num), (p1->coef.denom)*(p1->degre+1)), (p1->degre+1));
if (t) {
if (resultat) {
temp->suiv = t;