public Polynome Dérivée () { var poly = new Polynome (); for (int k = 1; k <= Degré; k++) { poly.AddCoefficient (k - 1, k * GetCoefficient (k)); } return poly; }
public static Polynome operator /(Polynome A, Polynome B) { var Q = new Polynome (); while (A.Degré >= B.Degré) { var C = new Polynome (); C.AddCoefficient ((A.Degré - B.Degré) * Convert.ToInt32(A.Degré >= B.Degré), A.GetCoefficient (A.Degré) / B.GetCoefficient (B.Degré)); A -= B * C; Q += C; } return Q; }
public static Polynome operator *(Polynome A, Polynome B) { var poly = new Polynome (); for (int k = 0; k <= A.Degré; k++) { for (int l = 0; l <= B.Degré; l++) { poly.AddCoefficient (k+l, A.GetCoefficient (k) * B.GetCoefficient (l)); } } return poly; }
public static Polynome operator -(Polynome A, Polynome B) { var poly = new Polynome (); for (int k = 0; k <= Math.Max(A.Degré, B.Degré); k++) { poly.AddCoefficient (k, A.GetCoefficient(k)-B.GetCoefficient(k)); } return poly; }