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

Going ahead to step 1:
When dividing 5 by 40, we get 0 with a remainder of 5.
Write down 0 as next digit of the result. 
Result so far: 0.0
Subtract 0 from 5 to get 5.
Fetch the next digit (3) from the dividend, attach it to 5 and continue: 53 / 40

Let's proceed to step 2:
The number 40 fits into 53 1 times, leaving a remainder of 13.
The next digit of our result is 1. 
Result so far: 1.0
If we take 40 away from 53, we end up with 13.
Include the next digit (8) from the dividend after 13, then repeat: 138 / 40

On to step 3:
When dividing 138 by 40, we get 3 with a remainder of 18.
The next digit of our result is 3. 
Result so far: 13.0
The remainder is 18 after subtracting 120 from 138.
Include the next digit (8) from the dividend after 18, then repeat: 188 / 40

Moving on to step 4:
If we divide 188 by 40, we get 4 and a remainder of 28.
Put 4 as the next digit of the answer. 
Result so far: 134.0
Subtracting 160 from 188 leaves us with 28.
Fetch the next digit (4) from the dividend, attach it to 28 and continue: 284 / 40

Going ahead to step 5:
284 divided by 40 is 7 with a remainder of 4.
Put 7 as the next digit of the answer. 
Result so far: 1347.0
Subtract 280 from 284 to get 4.
Append the next digit (2) from the dividend to 4 and continue with: 42 / 40

Step 6:
42 divided by 40 is 1 with a remainder of 2.
Use 1 as the next digit of our solution. 
Result so far: 13471.0
Subtracting 40 from 42 leaves us with 2.
Since there are no more digits in the dividend, we add a zero to the remainder making it 20, and continue the process.

Moving on to step 7:
The number 40 fits into 20 0 times, leaving a remainder of 20.
The number 0 becomes the next digit in our result. 
Result so far: 13471.0
Deduct 0 from 20 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.

On to step 8:
200 divided by 40 is 5 with a remainder of 0.
The number 5 becomes the next digit in our result. 
Result so far: 13471.05
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 9:
0 divided by 40 is 0 with a remainder of 0.
Record the quotient 0 as the next digit in the result. 
Result so far: 13471.05
Subtract 0 from 0 to 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.

Advancing to step 10:
40 can be fit into 0 0 times, resulting in a remainder of 0.
Put 0 as the next digit of the answer. 
Result so far: 13471.05
Subtract 0 from 0 to 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.

In conclusion, the division gives 13471.05 with a balance of 0.0.