Tera supports standard mathematical calculations as well as prefix increment and decrement operations for numeric types.
You can perform mathematical operations and output the results directly using the built-in print statement:
print
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
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
There was an error while loading. Please reload this page.