Skip to content

Binary Operations

Binary Operations - basic math operations on numbers.

Supported

Supported Types For Binary Operations: int8 / int16 / int32 / int64

SignNameLimitations
+AddInteger Size Limits
-MinusInteger Size Limits
*MultiplyInteger Size Limits
/DivideInteger Size Limits, Cannot Divide By Zero

Examples

Simple binary operations:

tpl-lang
print(10 + 2);
print(10 - 2);
print(10 * 2);
print(10 / 2);

12
8
20
5


Binary assignment operations:

tpl-lang
int32 a = 10;

a += 1;
a -= 1;
a *= 2
a /= 5;

print(a);

4