Arithmetic operators
Arithmetic operators calculate values based on two or more numeric values.
Be sure that any tag value you use as a divisor cannot at some point have a value of zero. Expressions that attempt to divide a number by zero produce an error at runtime.
The following table lists the arithmetic operators.
Symbol | Operator | Example |
---|---|---|
+ | addition | tag_1 + tag_2 |
- | subtraction | tag_1 - tag_2 |
* | multiplication | tag_1 * tag_2 |
/ | division | tag_1 / tag_2 |
MOD, % | modulus (remainder) | tag_1 % tag_2 The modulus operator is the remainder of one number divided by another. For example, the remainder of 13 divided by 5 is 3; so 13 % 5 = 3 This operator is for integers only, not floating point numbers. |
** | exponent | tag_1 ** 2 |
Provide Feedback