Vensim supports standard unary and binary operators that observe conventional precedence. These operators are (in decreasing order of precedence):
Assignment Operators
= |
ordinary numeric |
== |
unchangeable constant |
:= |
data equation |
: |
subscript |
<-> |
subscript equivalence |
:IS: |
string literal |
Unary Operators:
:NOT: |
logical |
- + |
arithmetic |
Binary Operators
^ |
arithmetic-power |
* / + - |
arithmetic |
< > <= >= <> = |
logical relational |
:AND: |
logical |
:OR: |
logical-non exclusive |
•The relational and logical operators can only be used in function calls and are intended for use only with the IF THEN ELSE, SAMPLE IF TRUE and SHIFT IF TRUE functions.
•It is not permissible to use an arithmetic operator on a logical expression (an expression using a logical operator).
•The first assignment operator (=, := or ==) appearing in an equation is the unique assignment operator for that equation and must appear directly after the first variable name and data pattern or subscript exception keywords.
NOTE Precedence can be overridden using parentheses ( ). Reality Check statements are nonstandard in their use of operators including the assignment operator.