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

Moving on to step 1:
40 can be fit into 9 0 times, resulting in a remainder of 9.
Record the quotient 0 as the next digit in the result. 
Result so far: 0.0
Deduct 0 from 9 and we're left with 9.
Append the next digit (8) from the dividend to 9 and continue with: 98 / 40

Step 2:
98 divided by 40 is 2 with a remainder of 18.
The next digit of our result is 2. 
Result so far: 2.0
If we take 80 away from 98, we end up with 18.
Append the next digit (7) from the dividend to 18 and continue with: 187 / 40

Let's proceed to step 3:
40 goes into 187 4 times with a remainder of 27.
Write down 4 as next digit of the result. 
Result so far: 24.0
If we subtract 160 from 187, we get 27.
Include the next digit (1) from the dividend after 27, then repeat: 271 / 40

Going ahead to step 4:
40 can be fit into 271 6 times, resulting in a remainder of 31.
Record the quotient 6 as the next digit in the result. 
Result so far: 246.0
The remainder is 31 after subtracting 240 from 271.
Grab the next digit (1) from the dividend, add it to 31, then carry on: 311 / 40

Let's proceed to step 5:
When dividing 311 by 40, we get 7 with a remainder of 31.
The number 7 becomes the next digit in our result. 
Result so far: 2467.0
Deduct 280 from 311 and we're left with 31.
Fetch the next digit (2) from the dividend, attach it to 31 and continue: 312 / 40

Advancing to step 6:
40 can be fit into 312 7 times, resulting in a remainder of 32.
Put 7 as the next digit of the answer. 
Result so far: 24677.0
Subtract 280 from 312 to get 32.
Since there are no more digits in the dividend, we add a zero to the remainder making it 320, and continue the process.

Step 7:
320 divided by 40 is 8 with a remainder of 0.
The next digit of our result is 8. 
Result so far: 24677.8
The remainder is 0 after subtracting 320 from 320.
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:
When dividing 0 by 40, we get 0 with a remainder of 0.
The number 0 becomes the next digit in our result. 
Result so far: 24677.8
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.

Going ahead 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: 24677.8
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.

The quotient of the division is 24677.8, and the remainder is 0.0.