Operators
TeamDesk provides several operators that allow you to perform basic operations with values. These operators include the following groups:
Operator Precedence
If your formula contains more than one operation, a standard algebraic notation is used to calculate the result. You should take into account the standard order of operations. To determine the priority, refer to the following table:
| Operator | Priority |
|---|---|
| Parentheses | Highest priority |
| NOT logical operator | |
| Power operator | |
| Multiplication and division | |
| Addition, subtraction, and concatenation | |
| Comparison operators | |
| AND logical operator | |
| OR logical operator | Lowest priority |
Consider the following rules as well:
-
Unary operators such as
-,+, ornothave the highest priority. For example, in the formula10 * -5, the5will be converted to-5first, and then the multiplication will be carried out. -
Operations of the same priority are performed from left to right. In the formula
2 + 3 - 4, the3will be added to2first, and then4will be subtracted from the sum result. -
Operations of different priorities are performed in the order of their corresponding priority. In the formula
3 * 5 - 4 / 2, the3will be multiplied by5first, then4will be divided by2, and finally, the two resulting values will be summed. -
When you use parentheses, operations enclosed in parentheses will be performed first. If you use nested parentheses, for example,
10 - (2 * (5 + 2)), then the operation within the innermost parentheses -(5 + 2)- will be performed first.