Let's divide 877185 by 40
We want to figure out the number of times 877185 can be divided by 40.

Moving on to step 1:
If we divide 8 by 40, we get 0 and a remainder of 8.
Write down 0 as next digit of the result. 
Result so far: 0.0
If we subtract 0 from 8, we get 8.
Grab the next digit (7) from the dividend, add it to 8, then carry on: 87 / 40

Going ahead to step 2:
The number 40 fits into 87 2 times, leaving a remainder of 7.
Write down 2 as next digit of the result. 
Result so far: 2.0
Deduct 80 from 87 and we're left with 7.
Grab the next digit (7) from the dividend, add it to 7, then carry on: 77 / 40

Moving on to step 3:
If we divide 77 by 40, we get 1 and a remainder of 37.
The number 1 becomes the next digit in our result. 
Result so far: 21.0
Subtracting 40 from 77 leaves us with 37.
Bring next digit (1) of the dividend behind the 37 and repeat the process: 371 / 40

Step 4:
371 divided by 40 is 9 with a remainder of 11.
Write down 9 as next digit of the result. 
Result so far: 219.0
Deduct 360 from 371 and we're left with 11.
Fetch the next digit (8) from the dividend, attach it to 11 and continue: 118 / 40

Let's proceed to step 5:
40 can be fit into 118 2 times, resulting in a remainder of 38.
Put 2 as the next digit of the answer. 
Result so far: 2192.0
Deduct 80 from 118 and we're left with 38.
Include the next digit (5) from the dividend after 38, then repeat: 385 / 40

Let's proceed to step 6:
40 goes into 385 9 times with a remainder of 25.
Record the quotient 9 as the next digit in the result. 
Result so far: 21929.0
Subtracting 360 from 385 leaves us with 25.
Since there are no more digits in the dividend, we add a zero to the remainder making it 250, and continue the process.

On to step 7:
250 divided by 40 is 6 with a remainder of 10.
Put 6 as the next digit of the answer. 
Result so far: 21929.6
If we take 240 away from 250, we end up with 10.
Since there are no more digits in the dividend, we add a zero to the remainder making it 100, and continue the process.

Step 8:
100 divided by 40 is 2 with a remainder of 20.
Record the quotient 2 as the next digit in the result. 
Result so far: 21929.62
Deduct 80 from 100 and we're left with 20.
Since there are no more digits in the dividend, we add a zero to the remainder making it 200, and continue the process.

Let's proceed to step 9:
When dividing 200 by 40, we get 5 with a remainder of 0.
Record the quotient 5 as the next digit in the result. 
Result so far: 21929.625
Deduct 200 from 200 and we're left with 0.
Since there are no more digits in the dividend, we add a zero to the remainder making it 0, and continue the process.

Step 10:
0 divided by 40 is 0 with a remainder of 0.
Write down 0 as next digit of the result. 
Result so far: 21929.625
If we subtract 0 from 0, we get 0.
Since there are no more digits in the dividend, we add a zero to the remainder making it 0, and continue the process.

On to step 11:
0 divided by 40 is 0 with a remainder of 0.
The number 0 becomes the next digit in our result. 
Result so far: 21929.625
Deduct 0 from 0 and we're left with 0.
Since there are no more digits in the dividend, we add a zero to the remainder making it 0, and continue the process.

The final outcome is 21929.625, with a leftover of 0.0.