Arithmetic Operators

← Back to documentation


Operators

Operator Description Example Result
+ Addition / String concatenation 5 + 3
"Hello" + " World"
8
Hello World
- Subtraction 10 - 4 6
* Multiplication 6 * 7 42
/ Division 15 / 4 3.75
- (unary) Negation -5 -5

Examples

Basic arithmetic

a = 10
b = 3
print(a + b)   # 13
print(a - b)   # 7
print(a * b)   # 30
print(a / b)   # 3.3333333333333335

Float numbers

pi = 3.14159
radius = 5.0
area = pi * radius * radius
print(area)
# Output: 78.53975

String concatenation

first = "Hello"
second = "World"
result = first + " " + second + "!"
print(result)
# Output: Hello World!

Mixed types

name = "Jaf"
version = 2.0
print("Welcome to " + name + " " + version)
# Output: Welcome to Jaf 2.0

Precedence

result = 2 + 3 * 4    # 14 (multiplication first)
result = (2 + 3) * 4   # 20 (parentheses first)

Notes


See Also


© 2026 elliktronic · Jaf Language