Skip to content

Commit dc38269

Browse files
committed
explain rationale behind convention how monomials are represented
1 parent 3aab2e3 commit dc38269

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/sage/rings/semirings/tropical_mpolynomial.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -653,12 +653,17 @@ def _repr_(self):
653653
r"""
654654
Return a string representation of ``self``.
655655
656+
Note that ``x`` equals ``0*x``, which is different from
657+
``1*x``. Therefore, we represent monomials always together
658+
with their coefficients, to avoid confusion.
659+
656660
EXAMPLES::
657661
658662
sage: T = TropicalSemiring(QQ)
659663
sage: R.<x,y> = PolynomialRing(T)
660664
sage: x + R(-1)*y + R(-3)
661665
0*x + (-1)*y + (-3)
666+
662667
"""
663668
if not self.monomial_coefficients():
664669
return str(self.parent().base().zero())

0 commit comments

Comments
 (0)