840158 divided by 40 
We're looking to find how many times 40 goes into 840158.

Advancing to step 1:
8 divided by 40 is 0 with a remainder of 8.
Put 0 as the next digit of the answer. 
Result so far: 0.0
If we subtract 0 from 8, we get 8.
Include the next digit (4) from the dividend after 8, then repeat: 84 / 40

Let's proceed to step 2:
The number 40 fits into 84 2 times, leaving a remainder of 4.
The number 2 becomes the next digit in our result. 
Result so far: 2.0
Subtracting 80 from 84 leaves us with 4.
Include the next digit (0) from the dividend after 4, then repeat: 40 / 40

On to step 3:
40 can be fit into 40 1 times, resulting in a remainder of 0.
Record the quotient 1 as the next digit in the result. 
Result so far: 21.0
Deduct 40 from 40 and we're left with 0.
Include the next digit (1) from the dividend after 0, then repeat: 1 / 40

Step 4:
40 can be fit into 1 0 times, resulting in a remainder of 1.
The number 0 becomes the next digit in our result. 
Result so far: 210.0
If we take 0 away from 1, we end up with 1.
Include the next digit (5) from the dividend after 1, then repeat: 15 / 40

Going ahead to step 5:
15 divided by 40 is 0 with a remainder of 15.
Record the quotient 0 as the next digit in the result. 
Result so far: 2100.0
If we subtract 0 from 15, we get 15.
Grab the next digit (8) from the dividend, add it to 15, then carry on: 158 / 40

Moving on to step 6:
The number 40 fits into 158 3 times, leaving a remainder of 38.
Record the quotient 3 as the next digit in the result. 
Result so far: 21003.0
If we subtract 120 from 158, we get 38.
Since there are no more digits in the dividend, we add a zero to the remainder making it 380, and continue the process.

Advancing to step 7:
When dividing 380 by 40, we get 9 with a remainder of 20.
Use 9 as the next digit of our solution. 
Result so far: 21003.9
Deduct 360 from 380 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.

Step 8:
200 divided by 40 is 5 with a remainder of 0.
Use 5 as the next digit of our solution. 
Result so far: 21003.95
If we take 200 away from 200, we end up 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.

Advancing to step 9:
If we divide 0 by 40, we get 0 and a remainder of 0.
Use 0 as the next digit of our solution. 
Result so far: 21003.95
Subtracting 0 from 0 leaves us 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.

Moving on to step 10:
40 goes into 0 0 times with a remainder of 0.
The next digit of our result is 0. 
Result so far: 21003.95
If we take 0 away from 0, we end up 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.

After the division, we end up with 21003.95 and a remainder of 0.0.