987321 divided by 40 
We want to figure out the number of times 987321 can be divided by 40.

Let's proceed to step 1:
9 divided by 40 is 0 with a remainder of 9.
Record the quotient 0 as the next digit in the result. 
Result so far: 0.0
If we subtract 0 from 9, we get 9.
Fetch the next digit (8) from the dividend, attach it to 9 and continue: 98 / 40

Moving on to step 2:
The number 40 fits into 98 2 times, leaving a remainder of 18.
Record the quotient 2 as the next digit in the result. 
Result so far: 2.0
Subtracting 80 from 98 leaves us with 18.
Include the next digit (7) from the dividend after 18, then repeat: 187 / 40

On to step 3:
187 divided by 40 is 4 with a remainder of 27.
Write down 4 as next digit of the result. 
Result so far: 24.0
Deduct 160 from 187 and we're left with 27.
Include the next digit (3) from the dividend after 27, then repeat: 273 / 40

Going ahead to step 4:
When dividing 273 by 40, we get 6 with a remainder of 33.
The next digit of our result is 6. 
Result so far: 246.0
Deduct 240 from 273 and we're left with 33.
Bring next digit (2) of the dividend behind the 33 and repeat the process: 332 / 40

Going ahead to step 5:
If we divide 332 by 40, we get 8 and a remainder of 12.
Record the quotient 8 as the next digit in the result. 
Result so far: 2468.0
Deduct 320 from 332 and we're left with 12.
Grab the next digit (1) from the dividend, add it to 12, then carry on: 121 / 40

Going ahead to step 6:
If we divide 121 by 40, we get 3 and a remainder of 1.
Write down 3 as next digit of the result. 
Result so far: 24683.0
If we take 120 away from 121, we end up with 1.
Since there are no more digits in the dividend, we add a zero to the remainder making it 10, and continue the process.

Moving on to step 7:
If we divide 10 by 40, we get 0 and a remainder of 10.
Use 0 as the next digit of our solution. 
Result so far: 24683.0
If we take 0 away from 10, we end up with 10.
Since there are no more digits in the dividend, we add a zero to the remainder making it 100, and continue the process.

Going ahead to step 8:
When dividing 100 by 40, we get 2 with a remainder of 20.
Record the quotient 2 as the next digit in the result. 
Result so far: 24683.02
Deduct 80 from 100 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 9:
If we divide 200 by 40, we get 5 and a remainder of 0.
Use 5 as the next digit of our solution. 
Result so far: 24683.025
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.

Step 10:
The number 40 fits into 0 0 times, leaving a remainder of 0.
The next digit of our result is 0. 
Result so far: 24683.025
Deduct 0 from 0 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 11:
If we divide 0 by 40, we get 0 and a remainder of 0.
Write down 0 as next digit of the result. 
Result so far: 24683.025
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 final outcome is 24683.025, with a leftover of 0.0.