Math operators
Four basic operations and remainder.
Syntax
+ - * / %
Description
Division of two integers is an integer (7/2=3). At least one must be a Double for decimal results. % gives the remainder.
Example
Loading editor…
This language is for reference/learning only — copy the code and try it in your own environment.
Expected output
10 3 3.5 1
When to use?
Calculations, even/odd checks (x % 2).