Arithmetic Operators

Arithmetic Operators — (+, -, *, /, %)

Syntax

number + number
number - number
number * number
number / number
number % number

		

Arguments

number

Any integer or real number. Non-numbers are treated as zero.

Returns

The mathematical result of the operation.

Description

These operators perform simple mathematical operations on their arguments.

gives the sum of the two arguments.

gives the difference between the first and second arguments.

gives the product of the two arguments.

gives the first argument divided by the second argument.

gives the modulus of the first argument by the second, that is, the remainder of the integer division of the first argument by the second.

Example

Gamma> 5 + 6;
11
Gamma> 12 / 5;
2.3999999999999999112
Gamma> div(12,5);
2
Gamma> 19 % 5;
4
Gamma>