Operators
The following operators are available, under their mathematical acceptation.
Arithmetic operators
The arithmetic operators perform operations on real numbers. These operations are performed using a double precision for their floating-point implementation. The specific operations on integers have a function call syntax, e.g. factorial.
Operator | Syntax | Remarks |
---|---|---|
Equal | a=b | Defines variables |
Addition | a+b | |
Subtraction | a-b | |
Multiplication | a*b | |
Division | a/b | |
Power | a^b | Right associative |
Unitary plus | +a | |
Unitary minus | -a |
Logical operators
The logical operators perform operations on boolean values. They appear as conditions within conditional statements.
Operator | Syntax | Other possible syntax |
---|---|---|
Negation | ~a | !a |
Or | a|b | a||b |
And | a&b | a&&b |
Relational operators
The relational operators perform operations on real numbers. These operations are performed using a double precision for their floating-point implementation.
Operator | Syntax | Other possible syntax |
---|---|---|
Equal to | a==b | |
Not equal to | a~=b | a!=b |
Greater than | a>b | |
Less than | a<b | |
Greater or equal to | a>=b | |
Less or equal to | a<=b | 2 |