diff --git a/kryptools/poly.py b/kryptools/poly.py index a5de36c..46ee0f1 100644 --- a/kryptools/poly.py +++ b/kryptools/poly.py @@ -17,6 +17,8 @@ class Poly: """ print_reversed = True # print the terms in reversed order + print_x = "x" # variable for printing + print_pow = "^" # you can change this to "**" if you want it python style def __init__(self, coeff: list, ring=None, modulus: list = None): self.coeff = list(coeff) @@ -47,8 +49,8 @@ def prx(i: int) -> str: if i == 0: return "" if i == 1: - return "x" - return "x^" + str(i) + return self.__class__.print_x + return self.__class__.print_x + self.__class__.print_pow + str(i) if not self: return str(self.coeff[0])