Zadanie 3 - CRC #27

Closed
s426284 wants to merge 10 commits from s426284/DALGLI0:zad3 into master
Showing only changes of commit 074d255dab - Show all commits

View File

@ -7,7 +7,7 @@ class Polynomial:
def __init__(self, coef_list): def __init__(self, coef_list):
self.degree = len(coef_list) - 1 self.degree = len(coef_list) - 1
self.coefficients = coef_list self.coefficients = [x % Polynomial.n for x in coef_list]
@staticmethod @staticmethod
def add(p1, p2): def add(p1, p2):
@ -72,4 +72,4 @@ class Polynomial:
def gcd(p1, p2): def gcd(p1, p2):
if len(p2.coefficients) == 0: if len(p2.coefficients) == 0:
return p1 return p1
return Polynomial.gcd(p2, Polynomial.divide(p1, p2)) return Polynomial.gcd(p2, Polynomial.divide(p1, p2))