Arithmetic Operators - grivia0/projecttera GitHub Wiki
Arithmetic & Increment Operators
Tera supports standard mathematical calculations as well as prefix increment and decrement operations for numeric types.
1. Basic Arithmetic
You can perform mathematical operations and output the results directly using the built-in print statement:
print(6 / 3); // Division
print(6 * 4); // Multiplication
print(6 ** 4); // Exponentiation
print(6 % 4); // Modulo (Remainder)
print(6 - 4); // Subtraction
print(6 + 4); // Addition
2. Increment & Decrement Operators
Tera supports prefix increment (++) and decrement (--) operators to modify variable values inline:
let x: 5 => int;
print(++x); // Increments x before printing
print(--x); // Decrements x before printing