We look at the division of 40102851 by 509 
Our goal is to divide 40102851 by 509.

On to step 1:
When dividing 4 by 509, we get 0 with a remainder of 4.
Put 0 as the next digit of the answer. 
Result so far: 0.0
If we subtract 0 from 4, we get 4.
Bring next digit (0) of the dividend behind the 4 and repeat the process: 40 / 509

Let's proceed to step 2:
If we divide 40 by 509, we get 0 and a remainder of 40.
Use 0 as the next digit of our solution. 
Result so far: 0.0
The remainder is 40 after subtracting 0 from 40.
Bring next digit (1) of the dividend behind the 40 and repeat the process: 401 / 509

Step 3:
If we divide 401 by 509, we get 0 and a remainder of 401.
Record the quotient 0 as the next digit in the result. 
Result so far: 0.0
If we subtract 0 from 401, we get 401.
Include the next digit (0) from the dividend after 401, then repeat: 4010 / 509

On to step 4:
509 goes into 4010 7 times with a remainder of 447.
Record the quotient 7 as the next digit in the result. 
Result so far: 7.0
The remainder is 447 after subtracting 3563 from 4010.
Grab the next digit (2) from the dividend, add it to 447, then carry on: 4472 / 509

Advancing to step 5:
509 can be fit into 4472 8 times, resulting in a remainder of 400.
The next digit of our result is 8. 
Result so far: 78.0
Deduct 4072 from 4472 and we're left with 400.
Bring next digit (8) of the dividend behind the 400 and repeat the process: 4008 / 509

Going ahead to step 6:
509 goes into 4008 7 times with a remainder of 445.
Use 7 as the next digit of our solution. 
Result so far: 787.0
Deduct 3563 from 4008 and we're left with 445.
Include the next digit (5) from the dividend after 445, then repeat: 4455 / 509

Moving on to step 7:
509 can be fit into 4455 8 times, resulting in a remainder of 383.
Put 8 as the next digit of the answer. 
Result so far: 7878.0
The remainder is 383 after subtracting 4072 from 4455.
Take the next digit (1) from the dividend and append it to 383, then repeat: 3831 / 509

Advancing to step 8:
The number 509 fits into 3831 7 times, leaving a remainder of 268.
Use 7 as the next digit of our solution. 
Result so far: 78787.0
If we take 3563 away from 3831, we end up with 268.
Since there are no more digits in the dividend, we add a zero to the remainder making it 2680, and continue the process.

Step 9:
When dividing 2680 by 509, we get 5 with a remainder of 135.
Put 5 as the next digit of the answer. 
Result so far: 78787.5
The remainder is 135 after subtracting 2545 from 2680.
Since there are no more digits in the dividend, we add a zero to the remainder making it 1350, and continue the process.

Moving on to step 10:
509 can be fit into 1350 2 times, resulting in a remainder of 332.
The next digit of our result is 2. 
Result so far: 78787.52
Deduct 1018 from 1350 and we're left with 332.
Since there are no more digits in the dividend, we add a zero to the remainder making it 3320, and continue the process.

Let's proceed to step 11:
The number 509 fits into 3320 6 times, leaving a remainder of 266.
Record the quotient 6 as the next digit in the result. 
Result so far: 78787.526
The remainder is 266 after subtracting 3054 from 3320.
Since there are no more digits in the dividend, we add a zero to the remainder making it 2660, and continue the process.

Moving on to step 12:
When dividing 2660 by 509, we get 5 with a remainder of 115.
The next digit of our result is 5. 
Result so far: 78787.5265
Deduct 2545 from 2660 and we're left with 115.
Since there are no more digits in the dividend, we add a zero to the remainder making it 1150, and continue the process.

Going ahead to step 13:
1150 divided by 509 is 2 with a remainder of 132.
Write down 2 as next digit of the result. 
Result so far: 78787.52652
The remainder is 132 after subtracting 1018 from 1150.
Since there are no more digits in the dividend, we add a zero to the remainder making it 1320, and continue the process.

On to step 14:
The number 509 fits into 1320 2 times, leaving a remainder of 302.
The number 2 becomes the next digit in our result. 
Result so far: 78787.526522
Deduct 1018 from 1320 and we're left with 302.
Since there are no more digits in the dividend, we add a zero to the remainder making it 3020, and continue the process.

In conclusion, the division gives 78787.526522 with a balance of 3.02e-05.