The following numeric operators act on two numeric values, producing a numeric result.
Operator | Performs | Example |
---|---|---|
+ |
addition |
|
- |
subtraction |
|
* |
multiplication |
|
/ |
division |
|
\ |
integer divide (drop remainder) |
|
Mod |
remainder from integer division |
|
^ |
exponentiation |
|
Two of these operators are also used in other contexts. The plus sign acting on a pair of strings concatenates them into a new string value. The minus sign acting on a single number is a negation operator, producing a numeric result. The ampersand also performs string concatenation.
Operator | Performs | Example |
---|---|---|
- |
numeric negation |
|
+ |
string concatenation |
|
& |
string concatenation |
|