All common arithmetic operators are supported. Boolean operators are also fully supported. Boolean expressions are evaluated to be either 1 or 0 (true or false respectively).
An
indicates that the operator can be used with the specific type of variable.
Refer to the grammar for detailed information
about operator precedence.
| Double | Complex | String | Vector | ||
| Power | ^ | ||||
| Boolean Not | ! | ||||
| Unary Plus, Unary Minus | +x, -x | ||||
| Modulus | % | ||||
| Division | / | ||||
| Multiplication | * | ||||
| Addition, Subtraction | +, - | ||||
| Less or Equal, More or Equal | <=, >= | ||||
| Less Than, Greater Than | <, > | ||||
| Not Equal, Equal | !=, == | ||||
| Boolean And | && | ||||
| Boolean Or | || |
Note that you can always add new functions as described in the documentation. Each of the following functions can be applied to objects of the types indicated.
Functions added with addStandardFunctions():| Double | Complex | String | Vector | ||
| Sine | sin(x) | ||||
| Cosine | cos(x) | ||||
| Tangent | tan(x) | ||||
| Arc Sine | asin(x) | ||||
| Arc Cosine | acos(x) | ||||
| Arc Tangent | atan(x) | ||||
| Arc Tangent (with 2 parameters) | atan2(y, x) | ||||
| Hyperbolic Sine | sinh(x) | ||||
| Hyperbolic Cosine | cosh(x) | ||||
| Hyperbolic Tangent | tanh(x) | ||||
| Inverse Hyperbolic Sine | asinh(x) | ||||
| Inverse Hyperbolic Cosine | acosh(x) | ||||
| Inverse Hyperbolic Tangent | atanh(x) | ||||
| Natural Logarithm | ln(x) | ||||
| Logarithm base 10 | log(x) | ||||
| Exponential | exp(x) | ||||
| Absolute Value / Magnitude | abs(x) | ||||
| Random number (between 0 and 1) | rand() | ||||
| Modulus | mod(x,y) = x % y | ||||
| Square Root | sqrt(x) | ||||
| Sum | sum(x,y,z) | ||||
| If | if(cond,trueval,falseval) | ||||
| Str | str(x) | ||||
| Binomial coeficients | binom(n,i) | Integer values |
| Double | Complex | String | Vector | ||
| Real Component | re(c) | ||||
| Imaginary Component | im(c) | ||||
| Complex Modulus (Absolute Value) | cmod(c) | ||||
| Argument (Angle of complex value, in radians) | arg(c) | ||||
| Complex conjugate | conj(c) | ||||
| Complex, constructs a complex number from real and imaginar parts | complex(x,y) | ||||
| Polar, constructs a complex number from modulus and argument | polar(r,theta) |