diff --git a/src/ExprNode.cc b/src/ExprNode.cc index 3acfc967f517120ce0c8576515603baa15af8ba4..3159204bb9cdef14b061fb9e31e8992ed3bceba9 100644 --- a/src/ExprNode.cc +++ b/src/ExprNode.cc @@ -4510,10 +4510,10 @@ BinaryOpNode::writeJsonOutput(ostream &output, close_parenthesis = false; /* Add parenthesis around right argument if: - - its precedence is lower than those of the current node + - its precedence is lower than that of the current node - it is a power operator and current operator is also a power operator - - it is a minus operator with same precedence than current operator - - it is a divide operator with same precedence than current operator */ + - it has same precedence as current operator and current operator is + either a minus or a divide */ auto barg2 = dynamic_cast<BinaryOpNode *>(arg2); if (int arg2_prec = arg2->precedenceJson(temporary_terms); arg2_prec < prec || (op_code == BinaryOpcode::power && barg2 && barg2->op_code == BinaryOpcode::power) @@ -4723,10 +4723,10 @@ BinaryOpNode::writeOutput(ostream &output, ExprNodeOutputType output_type, else { /* Add parenthesis around right argument if: - - its precedence is lower than those of the current node + - its precedence is lower than that of the current node - it is a power operator and current operator is also a power operator - - it is a minus operator with same precedence than current operator - - it is a divide operator with same precedence than current operator */ + - it has same precedence as current operator and current operator is + either a minus or a divide */ auto barg2 = dynamic_cast<BinaryOpNode *>(arg2); if (int arg2_prec = arg2->precedence(output_type, temporary_terms); arg2_prec < prec || (op_code == BinaryOpcode::power && barg2 && barg2->op_code == BinaryOpcode::power && !isLatexOutput(output_type))