Skip to main content

Arithmetical

Addition#

Symbol: +
Translated to JavaScript addition operator
It takes 2+ parameters.

+ 1 2
+ 1 2 3

Also can be used for string concatenation:

+ 'Hello, ' 'World!'

Subtraction#

Symbol: -
Translated to JavaScript subtraction operator

If it has 1 parameter it works as unary - and negates the number:

- 1

If it takes 2+ parameters it works as subtraction

- 2 1
- 10 3 2

Multiplication#

Symbol: *
Translated to JavaScript multiplication operator
It takes 2+ parameters.

* 2 2
* 2 3 5

Division#

Symbol: /
Translated to JavaScript division operator
It takes 2+ parameters.

/ 4 2
/ 30 3 10

Remainder#

Symbol: %
Translated to JavaScript remainder operator
It takes 2+ parameters.

% 5 2
% 25 7 2

Exponentiation#

Symbol: **
Translated to JavaScript exponentiation operator
It takes 2+ parameters.

** 2 2
** 2 3 5

Example#

The value of the following expression is 25:

+
* 2 4
/ 9 3
+ (* 3 2) (/ 4 2)
*
+ 1 2
/ 6 3