Operators
By: Will Cachine
Basic Math Operators
Addition = +
- intTotal = intNum1 + intNum2
Subtraction = -
- intTotal = intNum1 - intNum2
Multiplication = *
- intTotal = intNum1 * intNum2
Division = /
- intTotal = intNum1 / intNum2
Exponents = ^
- intTotal = intNum1 ^ intNum2
These are Some Other Types of Division Operators:
Regular Division
Regular division is the division you learned about in math class. You include both the integer and the remainder/decimal. Ex. 9 / 4 = 2.25
Integer Division
In Integer Division, the answer is simply the whole number you get after dividing. This means you leave out the remainder. Ex. 9 \ 4 = 2
Modular Division
In Modular division, the solution to the problem is the remainder, rather than the answer. Ex. 9 mod 4 = 1
Order of Operation
The order of operation is a system of logic that tells which operations are to be executed before others. In this system, the order is:
- Parentheses
- Exponents
- Multiplication
- Division
- Addition
- Subtration