Three calculators work in different way when I calculate: 50 + 10% * 20%

96 Views Asked by At

I've been working on developing simple calculator and currently working on order of operations for percent symbols. So when I trying the following equation, three different calculators show different results.

50 + 10% * 20% =

  • Apple iPhone calculator: 51
  • Apple macOS widget calculator: 55
  • Google web calculator: 11

Who result is the right and what calculator behaviour should I stick?

enter image description here

2

There are 2 best solutions below

2
On

Unless it's a scientific calculator, it probably won't do the standard order of operations for you, and will instead just do things in left-to-right order as you enter them.

Consider that $10\%=0.1$ and $20\% = 0.2$. Then $50 + (20\%)(10\%) = 50 + (0.1)(0.2) = 50 + 0.02 = 50.02$

In saying this, I do wonder what it is exactly that you're trying to calculate; I can't think of any purpose one might ever need to perform the calculation $50 + 10\% \cdot 20\%$, so I fear that you may be trying to calculate something incorrectly.

For example, if you've got $n$ things and want to add an extra $50\%$ of them, then the expression should not be $n+50\%$, it should be $n (150\%)$. It could be that you're entering the wrong expression for the problem you're trying to solve.

Edit: Also I should note that the Google online calculator had the same interpretation as me and yields $50.02$ as an answer, unlike the value of $11$ you assert in your question. I'm not sure how you entered the question to get 11.

Google calculator answer

0
On

My guess is as follows:

Google search bar =50.02 because it only accesses knowledge about PEMDAS getting the multiplication back as 0.02 which it then adds to 50.

Google Calculator on search results page= 11 because it likely interprets it as (50+10%*50)*20% or 55 over 5. Percents are of something.

Apple iphone probably interprets it as 50+(0.02*50)

Apple macOS widget, probably thinks the second percent doesn't make sense and ignores it , or was built for 2 operand expressions only.

Without meaning known ahead of time, All they can do is guess. All math is based on logical inference. definitions matter.