mirror of
https://gitee.com/openharmony/applications_app_samples
synced 2024-11-24 09:00:13 +00:00
!4527 master分支计算器计算逻辑不符合数学逻辑,出现计算错误
Merge pull request !4527 from ywz/master
This commit is contained in:
commit
128093d141
@ -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())
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user