Calculator: Calculation result is wrong in standard mode

Created on 7 Mar 2019  路  8Comments  路  Source: microsoft/calculator

There is a discrepancy between scientific mode and standard mode in the calculator. More precisely, standard mode displays wrong results.

Steps To Reproduce

  1. Choose either standard or scientific
  2. Type 100 - 5 * 2

Expected behavior
The result should be 90 because multiplication has priority over subtraction. In scientific mode the result is correct. In standard mode, the result display is 190 which is consistent with the subtraction being done before the multiplication.

Screenshots
calc

Application Information:

  • Application Version: 10.1804.2492.0

Additional context
This behavior is known since at least 2015.

won't fix

Most helpful comment

I think standard mode is analogous to conventional calculators that assume an = after every operator, in which case the current behaviour is correct.

The way 100 - 5 * 2 is displayed in the standard mode isn't making that obvious enough though...

All 8 comments

I think standard mode is analogous to conventional calculators that assume an = after every operator, in which case the current behaviour is correct.

The way 100 - 5 * 2 is displayed in the standard mode isn't making that obvious enough though...

The idea is to mimic this kind of calculator.

image

But I agree, the way History displays the operation isn't clear.

Yes, I think you're right. That what I thought also, but what's getting to me is that, the Microsoft Calculator is the only software calculator I know of that behave like that. I'm under the impression that all its competitors display 90 in their most basic/simple mode. So far, I've tested Android Calculator, Gnome Calculator and iOS Calculator.

But yeah, at least, changing the way the history is displayed would be a nice fix.

I think result is correct, but history is wrong. Why?
If you use standard calculator, you have input:100 - 5 * 2, which translates to ((100 - 5) * 2) or in RP notation: 100 5 - 2 *
I think history should show brackets for math operations, like I mentioned earlier:
'100' '-' '5' '*' '2' should be saved in history as: ((100 - 5) * 2 ) to correctly implement basic calculator.

Priority of operations is an elementary school program. It should always work and shouldn't mimic anything.

Duplicate of #138

Damned.

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

grochocki picture grochocki  路  25Comments

MicrosoftIssueBot picture MicrosoftIssueBot  路  20Comments

ivadham picture ivadham  路  18Comments

MicrosoftIssueBot picture MicrosoftIssueBot  路  16Comments

g-plane picture g-plane  路  55Comments