summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/fonctions.c39
1 files changed, 36 insertions, 3 deletions
diff --git a/lib/fonctions.c b/lib/fonctions.c
index 0b859a2..2ef2871 100644
--- a/lib/fonctions.c
+++ b/lib/fonctions.c
@@ -69,17 +69,50 @@ 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));
+ if (t) {
+ if (resultat) {
+ temp->suiv = t;
+ temp = t;
+ } else {
+ resultat = t;
+ temp = t;
+ }
+ }
+ }
+ p1=p1->suiv;
+ }
+ push_pile_poly(resultat);
}
void derivn(polynome p1, polynome p2, polynome p3)
{
- ;
+ int i;
+
+
}
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));
+ if (t) {
+ if (resultat) {
+ temp->suiv = t;
+ temp = t;
+ } else {
+ resultat = t;
+ temp = t;
+ }
+ }
+ p1=p1->suiv;
+ }
+ push_pile_poly(resultat);
}
void printvars(polynome p1, polynome p2, polynome p3)