Steply

Calculate 40 mod 8

Step by step, with the reason for every step · Remainders · Discrete Math

Step by step

The question

Question: work out 40 mod 8.

40 mod 8

Mod 8 means: the remainder after dividing by 8.

It is always a whole number from 0 to 7.

mod 8 = the remainder after ÷ 8
always 0 to 7

1 Divide by 8

Divide 40 by 8: 8 goes 5 times, that is 40, and 0 is left over.

40 = 8 × 5 + 0

Careful!

5 is how many times 8 goes in.

Mod asks for what is left over: 0.

Careful: not 40 mod 8 = 5 ✗

2 On the clock

Think of a clock with 8 numbers, 0 to 7.

So 40 mod 8 = 0.

40 mod 8 = 0

3 Check

Multiply back: 8 times 5, plus 0, is 40.

8 × 5 + 0 = 40 + 0 = 40

And 0 is from 0 to 7.

Right!

0 ≤ 0 < 8

Let's look back.

First: divide by 8.

Then: on the clock.

Last: check.

Answer
40 mod 8 = 0

Your turn

Try this one yourself, then check:

37 mod 8
Show the answer
37 mod 8 = 5

More from Remainders

The whole lesson: Remainders →