microsoft / calculator

Windows Calculator: A simple yet powerful calculator that ships with Windows
MIT License
29.49k stars 5.34k forks source link

Simple logic operation calculation value error #1456

Closed OneTop4458 closed 3 years ago

OneTop4458 commented 3 years ago

The result value is strange when calculating the following formula

image

Valid Result Value image


MicrosoftIssueBot commented 3 years ago

This is your friendly Microsoft Issue Bot. I've seen this issue come in and have gone to tell a human about it.

npaschos commented 3 years ago

The result you are seeing is calculated using the formula (468000 + 72000) * 3 = 1620000 whereas your desired result is 468000 + (72000 * 3) = 684000. You can get the second result by using the scientific calculator and parentheses to avoid confusion. Results in the standard mode are calculated as you type them. You can verify this by using any numbers in the formula you provided.

OneTop4458 commented 3 years ago

We already know that. But if it's a calculator, shouldn't it be based on priorities when calculating the company rules?

For any calculator, to obtain this formula, 468000 + (72000 3) = 684000, type 468000 + 72000 3 = 684000, who uses parentheses in simple calculations?

The conclusion seems wrong that the results of standard mode are calculated as input.

All of the standards must be calculated according to the rules of the law of the law we know. That is the way most people think calculators work.

mcooley commented 3 years ago

Thanks for the bug report! This issue is a duplicate of #138. As discussed there, the "immediate mode" behavior in standard mode is by design, but there is a change in progress to avoid showing incorrect expressions like the one in your example (spec).