We look at the division of 39794355 by 987 
Let's see how many times 987 fits into 39794355.

Advancing to step 1:
The number 987 fits into 3 0 times, leaving a remainder of 3.
Record the quotient 0 as the next digit in the result. 
Result so far: 0.0
Deduct 0 from 3 and we're left with 3.
Include the next digit (9) from the dividend after 3, then repeat: 39 / 987

Advancing to step 2:
When dividing 39 by 987, we get 0 with a remainder of 39.
Use 0 as the next digit of our solution. 
Result so far: 0.0
Subtracting 0 from 39 leaves us with 39.
Take the next digit (7) from the dividend and append it to 39, then repeat: 397 / 987

Moving on to step 3:
987 can be fit into 397 0 times, resulting in a remainder of 397.
The next digit of our result is 0. 
Result so far: 0.0
If we subtract 0 from 397, we get 397.
Fetch the next digit (9) from the dividend, attach it to 397 and continue: 3979 / 987

Moving on to step 4:
When dividing 3979 by 987, we get 4 with a remainder of 31.
Record the quotient 4 as the next digit in the result. 
Result so far: 4.0
If we subtract 3948 from 3979, we get 31.
Fetch the next digit (4) from the dividend, attach it to 31 and continue: 314 / 987

Let's proceed to step 5:
The number 987 fits into 314 0 times, leaving a remainder of 314.
Record the quotient 0 as the next digit in the result. 
Result so far: 40.0
Subtracting 0 from 314 leaves us with 314.
Bring next digit (3) of the dividend behind the 314 and repeat the process: 3143 / 987

On to step 6:
987 goes into 3143 3 times with a remainder of 182.
Put 3 as the next digit of the answer. 
Result so far: 403.0
The remainder is 182 after subtracting 2961 from 3143.
Include the next digit (5) from the dividend after 182, then repeat: 1825 / 987

Step 7:
1825 divided by 987 is 1 with a remainder of 838.
The number 1 becomes the next digit in our result. 
Result so far: 4031.0
Subtract 987 from 1825 to get 838.
Take the next digit (5) from the dividend and append it to 838, then repeat: 8385 / 987

Going ahead to step 8:
The number 987 fits into 8385 8 times, leaving a remainder of 489.
Record the quotient 8 as the next digit in the result. 
Result so far: 40318.0
If we subtract 7896 from 8385, we get 489.
Since there are no more digits in the dividend, we add a zero to the remainder making it 4890, and continue the process.

On to step 9:
When dividing 4890 by 987, we get 4 with a remainder of 942.
The number 4 becomes the next digit in our result. 
Result so far: 40318.4
The remainder is 942 after subtracting 3948 from 4890.
Since there are no more digits in the dividend, we add a zero to the remainder making it 9420, and continue the process.

On to step 10:
987 goes into 9420 9 times with a remainder of 537.
Write down 9 as next digit of the result. 
Result so far: 40318.49
The remainder is 537 after subtracting 8883 from 9420.
Since there are no more digits in the dividend, we add a zero to the remainder making it 5370, and continue the process.

Going ahead to step 11:
987 goes into 5370 5 times with a remainder of 435.
Record the quotient 5 as the next digit in the result. 
Result so far: 40318.495
If we subtract 4935 from 5370, we get 435.
Since there are no more digits in the dividend, we add a zero to the remainder making it 4350, and continue the process.

Advancing to step 12:
When dividing 4350 by 987, we get 4 with a remainder of 402.
Use 4 as the next digit of our solution. 
Result so far: 40318.4954
Deduct 3948 from 4350 and we're left with 402.
Since there are no more digits in the dividend, we add a zero to the remainder making it 4020, and continue the process.

Going ahead to step 13:
When dividing 4020 by 987, we get 4 with a remainder of 72.
Record the quotient 4 as the next digit in the result. 
Result so far: 40318.49544
If we take 3948 away from 4020, we end up with 72.
Since there are no more digits in the dividend, we add a zero to the remainder making it 720, and continue the process.

The final result is 40318.49544 with a remainder of 7.2e-05.