RDL2 Operators
The following table describes the operators in RDL2.
Operator | Synopsis | Description |
---|---|---|
= | Assignment | Assigns the value on the right side of the operator to the variable on the left. |
+ | Addition | Converts the operands on the left and right side of the operator and returns the sum. |
- | Subtraction | Converts the operands on the left and right side of the operator and returns the difference. |
* | Multiplication | Converts the operands on the left and right side of the operator and returns the product. |
/ | Division | Converts the operands on the left and right side of the operator and returns the quotient. |
% | Modulus | Converts the operands on the left and right side of the operator and returns the modulus. |
== | Equality | Test the operands on the left and the right side of the operator and tests for equality. The result is a Boolean. |
!= | Inequality | Test the operands on the left and the right side of the operator and tests for inequality. The result is a Boolean. |
>= | Greater than or equals. | If both operands are strings, then the result is true if the left operand appears later in the sorting order than the right operand or if the two strings are equal. Otherwise, both operands are converted to integers and the result is true if the left operand is greater than or equal to the right operand. |
<= | Less than or equals. | If both operands are strings, then the result is true if the left operand appears earlier in the sorting order than the right operand or if the two strings are equal. Otherwise, both operands are converted to integers and the result is true if the left operand is less than or equal to the right operand. |
> | Greater than | If both operands are strings, then the result is true if the left operand appears later in the sorting order than the right operand. Otherwise, both operands are converted to integers and the result is true if the left operand is greater than the right operand. |
< | Less than | If both operands are strings, then the result is true if the left operand appears earlier in the sorting order than the right operand. Otherwise, both operands are converted to integers and the result is true if the left operand is less than the right operand. |
&& | Logical AND | Results in true if both operands are true. |
|| | Logical OR | Results in true if either operand is true. |
! | Logical NOT | Performs a logical negation on the operand. Results in true if the operand is false, and false if the operand is true. |
& | String concatenation | Converts both operands to strings and concatenates them into a single string. |
Operator Precedence
Operators are evaluated in the following order:
- Unary positive, unary negative, unary negation
- Multiplication, division, modulus
- Addition, subtraction, string concatenation
- Greater than, less than, greater than or equal, less than or equal
- Equality, inequality
- Logical AND
- Logical OR