zad 4 #32

Closed
s426285 wants to merge 9 commits from s426285/DALGLI0:zad_4 into master
Showing only changes of commit d2187f2dbb - Show all commits

View File

@ -59,7 +59,7 @@ class Polynomial():
p1 = p1 * p1 p1 = p1 * p1
return p1 return p1
def __truediv__(self, p2): def __mod__(self, p2):
p1 = self p1 = self
m = self.mod m = self.mod
@ -95,7 +95,7 @@ class Polynomial():
if p2.poly == []: if p2.poly == []:
return p1 return p1
return p2.poly_gcd(p1 / p2) return p2.poly_gcd(p1 % p2)
def modDiv(a, b, m): # a*b^-1 (mod m) def modDiv(a, b, m): # a*b^-1 (mod m)
if gcd(b, m) != 1: if gcd(b, m) != 1: