00:02
All right, continuing our journey to become computer scientists, kind of shape this technological world we live in.
00:11
We're going to keep going with math.
00:12
We're going to talk about a new math operation.
00:14
Oh, haven't learned a new math operation since grade five.
00:17
Let's check it out.
00:18
It's called modulus.
00:20
So modulus is going to seem a little funky.
00:23
So 5 mod 2 is equal to 1.
00:26
I don't know what's going on there.
00:27
5 .10 mod 5 is 0.
00:30
20 mod 3 is it makes no sense whatsoever.
00:33
Well, it's important to think about what modulus is.
00:36
Modulus is a way of looking at the remainder after a division.
00:42
So those of you who can remember learning long division, if you still learned long division, we would reference the remainder, not necessarily as a decimal, but just as a remainder value.
00:53
So, for example, if you do five divided by two and you think about how many whole units are in each group, well, there's going to be two holes in each group.
01:02
So you've accounted for, four of the five.
01:05
And then how many are left over? well, there's one left over.
01:08
So yeah, you could say the answer is 2 .5 of 5 divided by 2, but you could also say the answer is 2 with a remainder of 1.
01:15
And that remainder is the answer we get from modulus.
01:19
So 10 divided by 5, even.
01:22
It divides evenly into two groups.
01:24
And there's nothing left over.
01:26
And so the modulus is 0.
01:28
If you tried to do 20 divided by three, you're going to get 6 .6666 repeating.
01:36
And so what we're really getting, though, is six times three is 18...