Operators

Common Arithmetic Operators

These operators should be consistent across every language.

Addition

+ operator Example:

Subtraction

- operator Example:

Multiplication

* operator Example:

Division

/ operator Example:

Modulo

% operator Example:

One of modulo's main uses, is to check if something is a factor of something else. For example, if number x is evenly divisible by number y (dividing them results in a remainder of 0), then y is a factor of x. Therefore, to check if y is a factor of x, you'd simply have to check if (x % y == 0).