diff --git a/src/tea3/pretty_print.py b/src/tea3/pretty_print.py index abbb604..6d68493 100644 --- a/src/tea3/pretty_print.py +++ b/src/tea3/pretty_print.py @@ -1,11 +1,11 @@ def pretty_print(poly): - ring = poly.parent() - R_terms = [] r_terms = [] x_terms = [] mixed_terms = [] + has_const = bool(poly.constant_coefficient()) + for monom in poly: vars_in_term = [str(v) for v in monom.variables()] @@ -26,6 +26,9 @@ def pretty_print(poly): parts = [] + if has_const: + parts.append("1") + if R_terms: parts.append("f(Ri)")