Math operators
Basic arithmetic, integer division, remainder, and exponentiation.
Syntax
+ - * / %/% %% ^
Description
/ gives a decimal. Integer division is done with %/%, remainder with %%, exponentiation with ^.
Example
Loading editor…
Expected output
10 3.5 3 1 1024
When to use?
Calculations, even/odd checks (x %% 2).
Common mistakes
- ⚠️ Integer division is %/%, remainder is %% (not a single %).