We're dividing 877959 by 40 
Let's see how many times 40 fits into 877959.

On to step 1:
If we divide 8 by 40, we get 0 and a remainder of 8.
The next digit of our result is 0. 
Result so far: 0.0
The remainder is 8 after subtracting 0 from 8.
Append the next digit (7) from the dividend to 8 and continue with: 87 / 40

Going ahead to step 2:
When dividing 87 by 40, we get 2 with a remainder of 7.
Write down 2 as next digit of the result. 
Result so far: 2.0
If we take 80 away from 87, we end up with 7.
Bring next digit (7) of the dividend behind the 7 and repeat the process: 77 / 40

Going ahead to step 3:
The number 40 fits into 77 1 times, leaving a remainder of 37.
Write down 1 as next digit of the result. 
Result so far: 21.0
If we subtract 40 from 77, we get 37.
Grab the next digit (9) from the dividend, add it to 37, then carry on: 379 / 40

Let's proceed to step 4:
40 goes into 379 9 times with a remainder of 19.
Record the quotient 9 as the next digit in the result. 
Result so far: 219.0
Deduct 360 from 379 and we're left with 19.
Fetch the next digit (5) from the dividend, attach it to 19 and continue: 195 / 40

Let's proceed to step 5:
When dividing 195 by 40, we get 4 with a remainder of 35.
The number 4 becomes the next digit in our result. 
Result so far: 2194.0
Subtract 160 from 195 to get 35.
Take the next digit (9) from the dividend and append it to 35, then repeat: 359 / 40

Let's proceed to step 6:
359 divided by 40 is 8 with a remainder of 39.
The number 8 becomes the next digit in our result. 
Result so far: 21948.0
Subtract 320 from 359 to get 39.
Since there are no more digits in the dividend, we add a zero to the remainder making it 390, and continue the process.

Moving on to step 7:
The number 40 fits into 390 9 times, leaving a remainder of 30.
Use 9 as the next digit of our solution. 
Result so far: 21948.9
Deduct 360 from 390 and we're left with 30.
Since there are no more digits in the dividend, we add a zero to the remainder making it 300, and continue the process.

Moving on to step 8:
40 can be fit into 300 7 times, resulting in a remainder of 20.
Record the quotient 7 as the next digit in the result. 
Result so far: 21948.97
If we subtract 280 from 300, we get 20.
Since there are no more digits in the dividend, we add a zero to the remainder making it 200, and continue the process.

Advancing to step 9:
The number 40 fits into 200 5 times, leaving a remainder of 0.
Write down 5 as next digit of the result. 
Result so far: 21948.975
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.

Let's proceed to step 10:
If we divide 0 by 40, we get 0 and a remainder of 0.
Put 0 as the next digit of the answer. 
Result so far: 21948.975
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.

Step 11:
The number 40 fits into 0 0 times, leaving a remainder of 0.
Write down 0 as next digit of the result. 
Result so far: 21948.975
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 21948.975, with a leftover of 0.0.