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

Going ahead to step 1:
The number 40 fits into 5 0 times, leaving a remainder of 5.
Put 0 as the next digit of the answer. 
Result so far: 0.0
If we subtract 0 from 5, we get 5.
Take the next digit (0) from the dividend and append it to 5, then repeat: 50 / 40

Step 2:
When dividing 50 by 40, we get 1 with a remainder of 10.
Use 1 as the next digit of our solution. 
Result so far: 1.0
Subtracting 40 from 50 leaves us with 10.
Bring next digit (2) of the dividend behind the 10 and repeat the process: 102 / 40

Step 3:
40 can be fit into 102 2 times, resulting in a remainder of 22.
Put 2 as the next digit of the answer. 
Result so far: 12.0
If we take 80 away from 102, we end up with 22.
Include the next digit (6) from the dividend after 22, then repeat: 226 / 40

Moving on to step 4:
226 divided by 40 is 5 with a remainder of 26.
Put 5 as the next digit of the answer. 
Result so far: 125.0
If we subtract 200 from 226, we get 26.
Take the next digit (7) from the dividend and append it to 26, then repeat: 267 / 40

On to step 5:
If we divide 267 by 40, we get 6 and a remainder of 27.
Record the quotient 6 as the next digit in the result. 
Result so far: 1256.0
If we take 240 away from 267, we end up with 27.
Take the next digit (6) from the dividend and append it to 27, then repeat: 276 / 40

Advancing to step 6:
When dividing 276 by 40, we get 6 with a remainder of 36.
Write down 6 as next digit of the result. 
Result so far: 12566.0
Subtract 240 from 276 to get 36.
Since there are no more digits in the dividend, we add a zero to the remainder making it 360, and continue the process.

Going ahead to step 7:
40 goes into 360 9 times with a remainder of 0.
Write down 9 as next digit of the result. 
Result so far: 12566.9
Deduct 360 from 360 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.

Moving on to step 8:
0 divided by 40 is 0 with a remainder of 0.
Put 0 as the next digit of the answer. 
Result so far: 12566.9
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.

Step 9:
When dividing 0 by 40, we get 0 with a remainder of 0.
The next digit of our result is 0. 
Result so far: 12566.9
The remainder is 0 after subtracting 0 from 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 12566.9 with a balance of 0.0.