1
0
forked from kalmar/DALGLI0
This commit is contained in:
Aleksy Wróblewski 2018-06-27 17:48:59 +00:00
parent d2187f2dbb
commit b34b9a42fb

4
hw4.py
View File

@ -49,7 +49,7 @@ class QuotientRing():
def idempotent(self):
idems = []
for rem in self.remainders:
if (rem * rem / self.f) == (rem / self.f):
if (rem * rem % self.f) == (rem % self.f):
idems.append(rem)
try:
if idems[0].poly == []: #implementacja wielomianow ucina zera
@ -63,7 +63,7 @@ class QuotientRing():
phi = len([ i for i in range(1, self.m) if gcd(i, self.m) == 1 ])
for zero_div in self.zero_divisors:
for i in range(self.m):
if len((zero_div ** i / self.f).poly) == 0:
if len((zero_div ** i % self.f).poly) == 0:
nils.append(zero_div)
break
return nils