We're dividing 499542 by 40 
Our goal is to divide 499542 by 40.

Going ahead to step 1:
The number 40 fits into 4 0 times, leaving a remainder of 4.
Write down 0 as next digit of the result. 
Result so far: 0.0
Subtract 0 from 4 to get 4.
Fetch the next digit (9) from the dividend, attach it to 4 and continue: 49 / 40

On to step 2:
The number 40 fits into 49 1 times, leaving a remainder of 9.
The next digit of our result is 1. 
Result so far: 1.0
Deduct 40 from 49 and we're left with 9.
Append the next digit (9) from the dividend to 9 and continue with: 99 / 40

Going ahead to step 3:
40 goes into 99 2 times with a remainder of 19.
Use 2 as the next digit of our solution. 
Result so far: 12.0
Deduct 80 from 99 and we're left with 19.
Fetch the next digit (5) from the dividend, attach it to 19 and continue: 195 / 40

Going ahead to step 4:
40 can be fit into 195 4 times, resulting in a remainder of 35.
The next digit of our result is 4. 
Result so far: 124.0
The remainder is 35 after subtracting 160 from 195.
Take the next digit (4) from the dividend and append it to 35, then repeat: 354 / 40

Going ahead to step 5:
40 can be fit into 354 8 times, resulting in a remainder of 34.
The number 8 becomes the next digit in our result. 
Result so far: 1248.0
Subtracting 320 from 354 leaves us with 34.
Bring next digit (2) of the dividend behind the 34 and repeat the process: 342 / 40

Step 6:
The number 40 fits into 342 8 times, leaving a remainder of 22.
Put 8 as the next digit of the answer. 
Result so far: 12488.0
If we subtract 320 from 342, we get 22.
Since there are no more digits in the dividend, we add a zero to the remainder making it 220, and continue the process.

Going ahead to step 7:
The number 40 fits into 220 5 times, leaving a remainder of 20.
The next digit of our result is 5. 
Result so far: 12488.5
Subtract 200 from 220 to 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.

Moving on to step 8:
200 divided by 40 is 5 with a remainder of 0.
The next digit of our result is 5. 
Result so far: 12488.55
Subtract 200 from 200 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.

Our division results in 12488.55 with a remaining 0.0.