In a complex expression, operations are performed according to their order of precedence. For instance, consider the mathematical expression in the following program:
This program will output "42". The mathematical operations are performed in this order:
Had the operations been performed in written order, left to right, the result would have been 102. You can force this order of evaluation using parentheses:
Any operation contained in parentheses is performed first. In the case of nested parentheses, the most deeply nested operations are performed first.
Operations of the same precedence level are performed in order from left to right. Thus the following program outputs "3":
Once again, you can use parentheses to change the order of operations:
The code above outputs "15".
The following table gives the precedence for OmniMark operators. Items at the top of the list have low precedence. That is, they are performed last. Items at the bottom of the list have high precedence and are performed first.
binary(when byte order is specified)
Note that if you overload an OmniMark operator, that operator retains its precedence order. However, if you write a function with the name of an OmniMark operator that is not overloadable, your function will override the OmniMark operator (even if your function is written as overloaded) and your function will fall into the "everything else" precedence category, despite the precedence of the name in this table.