def _print_Mul(self, expr):
"""Print a Mul object.
:param expr: The expression.
:rtype : str
:return: The printed string.
"""
assert isinstance(expr, _sympy.Mul)
# Get the precedence.
prec = _sympy_precedence.precedence(expr)
# Get commutative factors and non-commutative factors.
c, nc = expr.args_cnc()
# Print.
res = super(_MEXPPrinter, self)._print_Mul(expr.func(*c))
if nc:
res += '*'
res += '^'.join(self.parenthesize(a, prec) for a in nc)
return res
评论列表
文章目录