First off let's talk about a LITTLE mathematics.
There is a thing called an "
operator".
Now you might heard of military operations, but what on earth is an operator in mathematics?
An operator is a symbol that tells you that an action, an operation is taking place here.
Operators have one or two things that participate on that operation.
These "things" are called
operands.
An operand can be a number, a variable or a whole expression.
So we got an operator for addition.
It is the symbol +
and it adds
We say
12 + (7 * X - 83)
12 is the one
operand of
+ operator and the other
operand is the WHOLE expression
(7*X - 83) because of the parenthesis.
So we got it. We know what operator is.
And we know what an operand is.
Are there any other operators here?
Of course!
- for subtracting
* for multiplying
and.... what is THAT
% ????
This is called a
MOD operator from the word "modulo".
It's nothing exotic really. You do it all the time already.
Imagine the time, It's 17:00.
What time is it?
Since we measure time using
12 hour circles, we can divide 17 with 12.
Then the remainder will give us what time it is.
So 12 fits one time in 17 right? We don't care about how many times it fits.
We care about what remains 17 - 12 *1 =
5.
The remainder as we say.
OH! It's 5 O CLOCK IN THE EVENING.
So X MOD Y means you take X and divide it with Y.
You must find how many times, this Y fits as a WHOLE in X.
Let's say it fits Z times.
Then you subtract the Y*Z number from X.
What remains is the MOD.
Another example of MOD.
Now it's 12 o' clock!
What time will be after 79 HOURS?
6 * 12 = 72
79 - 72 = 7
Oh It will be 7 O clock!
79 MOD 12 = 7
79 % 12 = 7
Finally, there is a
priority in operators.
Some operators are just faster sexy than the others.
In general, when you see a
multiplier or a division,
they go first!!!
(Division is the same as multiplication. A / B = A * (1/

correct? )
So they have same priority cause it is the same thing.
So both multilication and division wear boots of haste!
Then comes what? The modulo. WRONG!
Alongside with them goes the modulo as Shaz correctly mentions.
This is the remainder so it is slightly slower.
Finally a subtraction is the same as addition. It's like adding a negative number.
( A - 3 = A + (-3) right? )
So addition and subtracion come to the end.
They run but they are more like marathon runners... they don't sprint.
Parentheses give higher priority than addition-subtraction.
It's like telling a marathon runner who runs slow... to suddenly sprint a little.
Parentehses apply to everything, giving an extra boost, like a power pill.
So... let's see...
100 - 25 * 3 % 4 = 97
100 - 75 % 4 = 97 (75 / 4 = 18,75. Take that 18 alone without decimals and do 18 * 4 = 72. So 75 - 72 = 3!!! )
100 - 75 % 4 = 97[SIZE=13.63636302948px] [/SIZE]
100 - 3 = 97
Got it?
EDIT: Correcting the chaos I made (thnaks Shaz)
Now I go to sleep.