Where does modulo come in the mathematical order of operation? I am guessing it is similar to division, but before or after?
This depends on the language, but in C style languages %
is the same precedence as *
and /
. This means that if it appears in the same expression (without parentheses) the order depends on the associativity. In this case %
is usually left-associative, so the operators will be executed in left-to-right order.