00:01
Operator precedence is the idea that one operator could happen before another regardless of the order in which they are processed.
00:12
So in this example, we have the formula 6 plus 2 times 3.
00:25
If we were to go by the default order of computers, we would be going from left to right.
00:35
So that would mean that the first operation that happens is the plus, and the next operation that happens is the times.
00:55
So we would do this one first and this one second.
01:01
That's if we were going left to right.
01:03
But there's different ways that we can go about this.
01:07
That would be if both of these had what's called the same precedence.
01:11
But the reality is that different operators have different precedence.
01:16
We think of the order of operations, right, where we would do things in parentheses first, and then we would do multiplication, division, and then we would do addition and subtraction.
01:28
And in computers, it works the same way.
01:32
Unless two operators have the same precedence, we do the things with the higher precedence first, and then we go left to right.
01:40
So in this case, if we went left to right, which would mean that addition has a higher precedence than multiplication, we would calculate things so that the first thing that's calculated would be 6 plus 2 equals 8...