Versions Compared

Key

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

...

Parentheses may be used to alter the order of the priority. Expressions that are enclosed within parentheses are evaluated prior to expressions without parentheses. Parentheses may also be used anywhere in an expression to clarify its order or to increase readability of the program.

See Also

Arithmetic expressions, Multi-value Arithmetic operators

Example

24 /2 * 4

The result will be 48.  Multiplication and division have the same priority.

24 / ( 2 * 4 ) = 3

The result will be 3.  The expression within the parentheses is evaluated first.