Arithmetic ( + - * / ** )
Four basic operations and exponentiation.
Syntax
a + b, a ** b
Description
** is the exponentiation operator. Integer division truncates the decimal. The mod() function is used for remainder (no %).
Example
Loading editor…
Expected output
1024 3
When to use?
Calculations.
Common mistakes
- ⚠️ Use mod(a,b) instead of % for remainders.