We're dividing 40229665 by 506 
Let's see how many times 506 fits into 40229665.

On to step 1:
When dividing 4 by 506, we get 0 with a remainder of 4.
The next digit of our result is 0. 
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 / 506

Advancing to step 2:
506 can be fit into 40 0 times, resulting in a remainder of 40.
Record the quotient 0 as the next digit in the result. 
Result so far: 0.0
If we take 0 away from 40, we end up with 40.
Grab the next digit (2) from the dividend, add it to 40, then carry on: 402 / 506

Advancing to step 3:
402 divided by 506 is 0 with a remainder of 402.
Use 0 as the next digit of our solution. 
Result so far: 0.0
If we take 0 away from 402, we end up with 402.
Include the next digit (2) from the dividend after 402, then repeat: 4022 / 506

Going ahead to step 4:
4022 divided by 506 is 7 with a remainder of 480.
Write down 7 as next digit of the result. 
Result so far: 7.0
Deduct 3542 from 4022 and we're left with 480.
Grab the next digit (9) from the dividend, add it to 480, then carry on: 4809 / 506

On to step 5:
If we divide 4809 by 506, we get 9 and a remainder of 255.
Use 9 as the next digit of our solution. 
Result so far: 79.0
Deduct 4554 from 4809 and we're left with 255.
Grab the next digit (6) from the dividend, add it to 255, then carry on: 2556 / 506

On to step 6:
If we divide 2556 by 506, we get 5 and a remainder of 26.
Write down 5 as next digit of the result. 
Result so far: 795.0
If we subtract 2530 from 2556, we get 26.
Take the next digit (6) from the dividend and append it to 26, then repeat: 266 / 506

Step 7:
506 can be fit into 266 0 times, resulting in a remainder of 266.
Record the quotient 0 as the next digit in the result. 
Result so far: 7950.0
The remainder is 266 after subtracting 0 from 266.
Include the next digit (5) from the dividend after 266, then repeat: 2665 / 506

Moving on to step 8:
2665 divided by 506 is 5 with a remainder of 135.
Put 5 as the next digit of the answer. 
Result so far: 79505.0
Deduct 2530 from 2665 and we're left with 135.
Since there are no more digits in the dividend, we add a zero to the remainder making it 1350, and continue the process.

Going ahead to step 9:
506 goes into 1350 2 times with a remainder of 338.
The next digit of our result is 2. 
Result so far: 79505.2
Subtracting 1012 from 1350 leaves us with 338.
Since there are no more digits in the dividend, we add a zero to the remainder making it 3380, and continue the process.

Let's proceed to step 10:
3380 divided by 506 is 6 with a remainder of 344.
Use 6 as the next digit of our solution. 
Result so far: 79505.26
Subtract 3036 from 3380 to get 344.
Since there are no more digits in the dividend, we add a zero to the remainder making it 3440, and continue the process.

On to step 11:
3440 divided by 506 is 6 with a remainder of 404.
Record the quotient 6 as the next digit in the result. 
Result so far: 79505.266
Subtract 3036 from 3440 to get 404.
Since there are no more digits in the dividend, we add a zero to the remainder making it 4040, and continue the process.

The final result is 79505.266 with a remainder of 0.0404.