Arithmetic operators
The +, -, *, /, (+), (-) operators create properties that implement arithmetic operations.
Syntax
expression1 + expression2
expression1 - expression2
expression1 * expression2
expression1 / expression2
expression1 (+) expression2
expression1 (-) expression2
- expression1
Description
The binary operators each take two operands and associate left to right; the unary minus takes a single operand. The evaluation order relative to other operators follows operator priority.
There are no dedicated operators for the remainder of division, integer division, or exponentiation — these operations are performed by the mod[…, …], divideInteger[…, …], and power[…, …] properties of the system module Utils.
Parameters
-
expression1, expression2Expressions whose values will be arguments for arithmetic operators.
Examples
sum(a, b) = a + b;
transform(a, b, c) = -a * (b (+) c);
remainder(a, b) = mod(a, b); // remainder of division — a property of the Utils module