Arithmetic

ufLang supports the following binary arithmetic operators:

Operator

Name

Description

Example

+

Addition

Adds two operands.

3 + 5 = 8

-

Subtraction

Subtracts the second operand from the first.

7 - 2 = 5

*

Multiplication

Multiplies two operands.

4 * 6 = 24

/

Division

Divides the first operand by the second.

10 / 2 = 5.0

%

Modulo

Returns the remainder of the division of the two operands.

10 % 3 = 1

⚠️ The result will be a Float or Double if one or more operands are of these types; otherwise, it will retain the base type. ⚠️

Last updated