__truediv__ to __mod__

This commit is contained in:
Aleksy Wróblewski 2018-06-27 17:48:31 +00:00
parent f4885f813b
commit d2187f2dbb

View File

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