Expression Operators
Templex follows the standard mathematical order of operations when an expression is evaluated.
Expressions can contain constants, variables, unary or binary operators, and mathematical or string manipulating functions.
Symbol | Operation | Associativity |
---|---|---|
() | Function argument, parenthesis | left to right |
! | Logical NOT | right to left |
+ | Plus | (unary +) |
- | Minus | |
^ | Raise to power | right to left |
* | Multiply | left to right |
/ | Divide | |
% | Modulus | |
+ | Add | left to right |
- | Subtract | |
< | Less than | left to right |
> | Greater than | |
<= | Less than or equal to | |
>= | Greater than or equal to | |
== | Equal to | left to right |
!= | Not equal to | |
&& | Logical AND | left to right |
|| | Logical OR | left to right |
sqrt(x1^2 + x2^2) - 2 * rate^2
-abs(sin((dtor(-theta))/(2+x))^3)
!((answer == "Y") && (wheelbase >= 9))