![]() ![]() |
|
Help for Process Engine Reference | |
Search | Index | |
![]() |
|
![]() |
![]() |
![]() |
OperatorsOperators indicate what operations, such as addition and subtraction, are to be performed on other parts of an expression. Some operators have different meanings based on the data types being operated upon. For example, the plus sign (+) can indicate either addition between integers or concatenation between strings. In a complex expression, the operators are evaluated in order of precedence. The following table lists the meaning of each operator. The operators are listed in order of precedence.
Operator usageIn an expression, the operands and result usually must be of the same data type and the operators must be valid for that data type. Note that mixing of numeric data types (that is, floats and integers) within an expression is allowed—for example, the expressions shown below are valid (FloatVal is a variable of type float): 3 * 2.5 FloatVal > 2 In mixed-type expressions, the integers are implicitly converted to floats before the operations are performed. Operator precedenceWithin an expression, operators with the same precedence are evaluated from left to right. In the integer expression shown below, for example, because division and multiplication have the same precedence, 6 is divided by 4, then the result is truncated (because the divisor and the dividend are integers) and multiplied by 2. 6/4*2 = 2 In an expression with many mixed-precedence operators, liberal use of parentheses makes the expression easier to understand and maintain. For example, below are two versions of the same expression; the parentheses used in the second version, however, make the expression logic more clear. Num + 2 > 80 or Num - 2 < -20 ((Num + 2) > 80) or ((Num - 2) < -20)
|
![]() |
|
![]() |
|