Operators
Expression Syntax: Operators
DPL Studio uses three types of operators in its expression syntax arithmetic, relational, and logical.
Arithmetic operators
Arithmetic operators are represented by the symbols + (addition), - (subtraction), / (division), * (multiplication), and % (modulus--the remainder after dividing two integers). The operators can be applied to scalar and vector data.
| Operator | Operation | Example | Result |
|---|---|---|---|
| + | addition | 2 + 3 | 5 |
| - | subtraction | 2 - 3 | -1 |
| / | division | 4 / 2 | 2 |
| * | multiplication | 2 * 3 | 6 |
| % | modulus | 5 % 3 | 2 |
Relational operators
Relational operators compare two values and return the result of the comparison as a Boolean value of True or False. Digital Process Logic Studio supports the six operators listed below. Digital process logic studio supports the common database operators In and Between as functions; for more details, see their descriptions in the function section.
| Operator | Operation | Example | Result |
|---|---|---|---|
| = | equals | 0 = 1 | False |
| <> | not equals | 0 < > 1 | True |
| > | greater than | 0 > 1 | False |
| < | less than | 0 < 1 | True |
| >= | greater than or equal to | 0 >= 1 | False |
| <= | less than or equal to | 0<=1 | True |
Logical operators
Arithmetic operators are represented by the symbols + (addition), - (subtraction), / (division), * (multiplication), and % (modulus--the remainder after dividing two integers). The operators can be applied to scalar and vector data. Logical operators (also called propositional operators) operate against two Boolean values, DPL Studio supports the operators And, Or and Not, as described below
.
| Operator | Operation | Example | Result |
|---|---|---|---|
| And | both statements are true | (5>3) And (5>4) | True |
| Or | at least one statement is true | (5<3) Or (5>4) | True |
| Not | neither statement is true | Not ((5<3) Or (5>4)) | False |