none
calculator

    Question

  • Hi folks

    I am using Microsoft Windows 7 64bit OS, there is some mistake in calculation while I am using Ms Calculator

    eg: 2+3+3*11=88

    But I should get 38....

    Why?

    Wednesday, April 26, 2017 2:41 PM

Answers

  • A calculator is not a compiler and it does not know the operator precedence. It just takes instructions in the order that you type and calculates sequentially based on the calculations so far.

    In this case, here is what happens:

    You press 2 and press + and then 3 (by this time the calculator assumes you are done with calculation) But when you press + then it assumes that you want to start a new calculation from the last output.

    Essentially what you are doing is:

    2 + 3 = 5

    5 + 3 = 8

    8 * 11 = 88

    If you want precedence to be taken into account then you can use something like google calculator.

    Try

    https://www.google.com/#q=2%2B3%2B3*11

    Thanks,

    Hari


    Hari Mothukuri


    Wednesday, April 26, 2017 8:49 PM
  • Hi AshrafCK,

    You can look into below thread's answer. As it is says "Windows calculator honors operator precedence when calculating in Scientific mode". If you switch to Scientific you get the correct result.

    It is not a mistake Standard/ Basic calculator are not intelligent enough to follow the operator precedence. They operation depending on your input order. It is not just MS Calculator a basic calculator on any desk does the same. You have to switch to scientific to do operation on operator's precedence.

    Windows calculator does not follow basic rules

    Calculator


    Thanks,
    Sabah Shariq

    [If a post helps to resolve your issue, please click the "Mark as Answer" of that post or click Answered"Vote as helpful" button of that post. By marking a post as Answered or Helpful, you help others find the answer faster. ]


    Thursday, April 27, 2017 12:55 PM
    Moderator

All replies

  • A calculator is not a compiler and it does not know the operator precedence. It just takes instructions in the order that you type and calculates sequentially based on the calculations so far.

    In this case, here is what happens:

    You press 2 and press + and then 3 (by this time the calculator assumes you are done with calculation) But when you press + then it assumes that you want to start a new calculation from the last output.

    Essentially what you are doing is:

    2 + 3 = 5

    5 + 3 = 8

    8 * 11 = 88

    If you want precedence to be taken into account then you can use something like google calculator.

    Try

    https://www.google.com/#q=2%2B3%2B3*11

    Thanks,

    Hari


    Hari Mothukuri


    Wednesday, April 26, 2017 8:49 PM
  • Hi AshrafCK,

    You can look into below thread's answer. As it is says "Windows calculator honors operator precedence when calculating in Scientific mode". If you switch to Scientific you get the correct result.

    It is not a mistake Standard/ Basic calculator are not intelligent enough to follow the operator precedence. They operation depending on your input order. It is not just MS Calculator a basic calculator on any desk does the same. You have to switch to scientific to do operation on operator's precedence.

    Windows calculator does not follow basic rules

    Calculator


    Thanks,
    Sabah Shariq

    [If a post helps to resolve your issue, please click the "Mark as Answer" of that post or click Answered"Vote as helpful" button of that post. By marking a post as Answered or Helpful, you help others find the answer faster. ]


    Thursday, April 27, 2017 12:55 PM
    Moderator
  • Hi AshrafCK,

    If your issue is solved please Mark as answer or Vote as helpful post to the appropriate answer so that it will help other members to find solution if they faces similar issue.

    Your understanding and cooperation will be grateful.

    Thanks,
    Sabah Shariq

    [If a post helps to resolve your issue, please click the "Mark as Answer" of that post or click Answered "Vote as helpful" button of that post. By marking a post as Answered or Helpful, you help others find the answer faster. ]

    Friday, May 12, 2017 12:58 PM
    Moderator