//differentiation.c
#include <stdio.h>
#include <stdlib.h>
#include "struc.h"




void deriv_polynome ( ptr_liste L1, ptr_liste *Lo)
{
    ptr_liste newstruct;//temporaire pour une nouvelle structure
    ptr_liste temp;//temporaire de Lo
    ptr_liste tempL1=L1;//temporaire de la liste chainé L1


    while (tempL1!=NULL && tempL1->exp>0)
    {
        newstruct=(ptr_liste)malloc(sizeof(list));
        newstruct->suivant=NULL;
        newstruct->exp=tempL1->exp-1;
        newstruct->coef=(tempL1->coef)*(tempL1->exp);
        tempL1=tempL1->suivant;

          if (*Lo==NULL)
          {
          *Lo=newstruct;
          temp=*Lo;
          }
          else
          {
          temp->suivant=newstruct;
          temp=temp->suivant;
          }

    }
}


