<< Click to Display Table of Contents >> Home mIoTa BASIC > mIoTa BASIC Language Reference > Lexical Elements > Tokens > Operators > Arithmetic Operators |
Arithmetic operators are used to perform mathematical computations. They have numerical operands and return numerical results.
Operator |
Operation |
+ |
addition |
- |
subtraction |
* |
multiplication |
/ |
division |
MOD |
modulus (returns the remainder of integer division) |
Operator '-' can also be used as a prefix unary operator to change sign of a signed value.
For example:
u1 = -u1; // negate contents of u1 |
Division by zero such as 'x / y', where y is 0 (zero), the result will be the maximum integer for the resultant variable (i.e 255, if the result is byte type or 65536, if the result is word type, etc.).