|
Operator Reference |
Top Previous Next |
|
Mathematical Operators
All mathematical expressions should be enclosed in parentheses if it is uncertain how the precedence will be applied.
+ result = ( expression1 + expression2 ) Sums two variables.
- result = ( expression1 - expression2 ) Finds the difference between two numbers.
* result = ( expression1 * expression2 ) Multiplies two numbers.
/ result = ( expression1 / expression2 ) Divides two numbers.
^ result = ( expression1 ^ expression2 ) Raises expression1 to the power of an expression2. The result is always floating.
mod or % result = ( expression1 mod expression2 ) Divides the value of one expression by the value of another, and returns the remainder. The left and right expressions can be floating or integer. The results will be float or int depending on the values used.
example: dayOfWeek = instrument.julianDate mod 7
Boolean Operators
These operators can be enclosed in parentheses like a mathematical expression to force evaluation in a certain order.
IF ( ( a = 1 ) AND ( b > 5 ) ) OR ( ( a = 2 ) AND ( b < 6 ) AND ( NOT c ) ) THEN
or expression1 or expression2 Performs a logical disjunction on two expressions. The result is always an integer.
and expression1 and expression2 Performs a logical conjunction on two expressions. The result is always an integer.
not not expression Performs logical negation on an expression. The result is always an integer.
|