Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

C programmers commonly make errors regarding the precedence rules of C operators due to the unintuitive low-precedence levels of " &", " |", " ^", " <<", and " >>". Mistakes regarding precedence rules can be avoided by the suitable use of parentheses. Using parentheses defensively reduces errors and, if not taken to excess, makes the code more readable.

...

EXP00-EX1: Mathematical expressions that follow algebraic order do not require parentheses. For instance, in the expression:

Code Block
x + y * z

the multiplication is performed before the addition by mathematical convention. Consequently, parenthesis parentheses to enforce this would be redundant.

...