Priority rules to arithmetic operators or hierarchy of arithmetic operations

Priority rules to arithmetic operators or hierarchy of arithmetic operations


    1. The exponential is performed first. When more than one operator is used in an expression and no parentheses are specified, evaluation is performed form left to right. Thus 3 +2 6/3 is first reduced to 3 +64/3 and then to 24.33
    2. Multiplication and division are done after exponentiation. When two or more operators appear in sequence and parentheses are not used, the evaluation of the expression proceeds from left to right. Thus the expression 4 * 5 / 2 * 8 is first reduced to 20 / 2 * 8 then to 10 * 8 finally to 80.
    3. Addition and subtraction are performed last of all.
    Eg :
    eg

    eg


    When parenthesis is used, the number of opening parentheses must be equal to the number of the closing parentheses. Parentheses may be contained within the other. This is called Nesting.
    For eg:
    nesting.jpg

    Parentheses (1) is nested within parentheses (2) while (2) is nested in (3). First the expression in (1) is evaluated, then the expression in (2) is computed and last of all the contents of (3) are calculated.

Last modified: Wednesday, 18 January 2012, 11:18 PM