!4527 master分支计算器计算逻辑不符合数学逻辑,出现计算错误

Merge pull request !4527 from ywz/master
This commit is contained in:
openharmony_ci 2024-06-26 09:12:39 +00:00 committed by Gitee
commit 128093d141
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -96,7 +96,7 @@ function toSuffixExpression(expression) {
} else {
topOperator = operatorStack[operatorStack.length - 1]
if (!isGrouping(topOperator) && !isPrioritized(element, topOperator)) {
while (operatorStack.length) {
while (operatorStack.length && !isPrioritized(element, operatorStack[operatorStack.length - 1])) {
suffixExpression.push(operatorStack.pop())
}
}