Operators

<< Click to Display Table of Contents >>

Navigation:  Model Definition > Ventity Language >

Operators

Previous pageReturn to chapter overviewNext page

The following operators may be used in equations,

 

 

Math Operators:

 

+, -, *,  /, ^

Arithmetic operators: add, subtract, multiply, divide, exponentiate.

 

 

 

Logic Operators:

 

 

==, !=, <>, <, <=, >, 
>=

 

Comparison operators. Comparisons between two quantities return true or false. "!=" and "<>" both mean "not equal".

 

!, not, &&  

Boolean operators. "!" and "not" both mean "not", "&&" means "and". "=" and "==" are equivalent in Ventity.

 

If (C) {X} Else {Y}

 

Returns X if condition C is true, and Y if false. Example: if (mood=="indigo") {x} else {2*z}

 

If (C1) {X1} 

   Else If (C2) {X2} 

   ...
   Else {Y}

Returns X1 if condition C1 is true, X2 if condition C2 is true and so on.  If none of the conditions are true, returns Y. If more than one condition is true, returns the first one in the sequence. As many "Else If (condition) {results}" as you wish may be added between the initial "If" and the final "Else {result}".

 

True, False

Special values that can be used in place of a logical test.