Skip to content

Commit 31fab1d

Browse files
lichaofan2008deepin-bot[bot]
authored andcommitted
fix: 10% should not rely on the preceding numerical values.
The calculation of 10% should not rely on the preceding numerical values. User expectation: 10% + 10% = 0.2 10%的计算不应该依赖其前面的数值,用户期望:10%+10%=0.2。 Bug: https://pms.uniontech.com/bug-view-347383.html
1 parent f937650 commit 31fab1d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

3rdparty/core/evaluator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2181,7 +2181,7 @@ Quantity Evaluator::exec(const QVector<Opcode> &opcodes,
21812181
default:
21822182
val2 = Quantity(1);
21832183
}
2184-
val1 = checkOperatorResult(val2 * (val1 * HNumber("0.01")));
2184+
val1 = checkOperatorResult(/*val2 * */(val1 * HNumber("0.01"))); // 10%的计算不应该依赖其之前的数值,用户期望:10%+10%=0.2
21852185
m_standardPercent = val1;
21862186
stack.push(val1);
21872187
break;

0 commit comments

Comments
 (0)