We divide 40172159 by 507
We want to divide 40172159 by 507.

Advancing to step 1:
If we divide 4 by 507, we get 0 and a remainder of 4.
The number 0 becomes the next digit in our result. 
Result so far: 0.0
The remainder is 4 after subtracting 0 from 4.
Include the next digit (0) from the dividend after 4, then repeat: 40 / 507

Step 2:
The number 507 fits into 40 0 times, leaving a remainder of 40.
Record the quotient 0 as the next digit in the result. 
Result so far: 0.0
If we subtract 0 from 40, we get 40.
Fetch the next digit (1) from the dividend, attach it to 40 and continue: 401 / 507

Step 3:
If we divide 401 by 507, we get 0 and a remainder of 401.
The number 0 becomes the next digit in our result. 
Result so far: 0.0
The remainder is 401 after subtracting 0 from 401.
Bring next digit (7) of the dividend behind the 401 and repeat the process: 4017 / 507

Let's proceed to step 4:
When dividing 4017 by 507, we get 7 with a remainder of 468.
The number 7 becomes the next digit in our result. 
Result so far: 7.0
Deduct 3549 from 4017 and we're left with 468.
Take the next digit (2) from the dividend and append it to 468, then repeat: 4682 / 507

Advancing to step 5:
4682 divided by 507 is 9 with a remainder of 119.
Write down 9 as next digit of the result. 
Result so far: 79.0
If we subtract 4563 from 4682, we get 119.
Include the next digit (1) from the dividend after 119, then repeat: 1191 / 507

Moving on to step 6:
If we divide 1191 by 507, we get 2 and a remainder of 177.
The next digit of our result is 2. 
Result so far: 792.0
If we subtract 1014 from 1191, we get 177.
Include the next digit (5) from the dividend after 177, then repeat: 1775 / 507

Moving on to step 7:
507 goes into 1775 3 times with a remainder of 254.
The number 3 becomes the next digit in our result. 
Result so far: 7923.0
Subtracting 1521 from 1775 leaves us with 254.
Fetch the next digit (9) from the dividend, attach it to 254 and continue: 2549 / 507

On to step 8:
507 goes into 2549 5 times with a remainder of 14.
The number 5 becomes the next digit in our result. 
Result so far: 79235.0
Deduct 2535 from 2549 and we're left with 14.
Since there are no more digits in the dividend, we add a zero to the remainder making it 140, and continue the process.

On to step 9:
507 goes into 140 0 times with a remainder of 140.
Write down 0 as next digit of the result. 
Result so far: 79235.0
Subtracting 0 from 140 leaves us with 140.
Since there are no more digits in the dividend, we add a zero to the remainder making it 1400, and continue the process.

On to step 10:
When dividing 1400 by 507, we get 2 with a remainder of 386.
Use 2 as the next digit of our solution. 
Result so far: 79235.02
If we subtract 1014 from 1400, we get 386.
Since there are no more digits in the dividend, we add a zero to the remainder making it 3860, and continue the process.

Moving on to step 11:
3860 divided by 507 is 7 with a remainder of 311.
Record the quotient 7 as the next digit in the result. 
Result so far: 79235.027
Subtracting 3549 from 3860 leaves us with 311.
Since there are no more digits in the dividend, we add a zero to the remainder making it 3110, and continue the process.

Going ahead to step 12:
507 can be fit into 3110 6 times, resulting in a remainder of 68.
The number 6 becomes the next digit in our result. 
Result so far: 79235.0276
The remainder is 68 after subtracting 3042 from 3110.
Since there are no more digits in the dividend, we add a zero to the remainder making it 680, and continue the process.

Step 13:
507 goes into 680 1 times with a remainder of 173.
Put 1 as the next digit of the answer. 
Result so far: 79235.02761
Deduct 507 from 680 and we're left with 173.
Since there are no more digits in the dividend, we add a zero to the remainder making it 1730, and continue the process.

Let's proceed to step 14:
When dividing 1730 by 507, we get 3 with a remainder of 209.
Record the quotient 3 as the next digit in the result. 
Result so far: 79235.027613
Subtracting 1521 from 1730 leaves us with 209.
Since there are no more digits in the dividend, we add a zero to the remainder making it 2090, and continue the process.

Let's proceed to step 15:
507 goes into 2090 4 times with a remainder of 62.
Put 4 as the next digit of the answer. 
Result so far: 79235.0276134
If we subtract 2028 from 2090, we get 62.
Since there are no more digits in the dividend, we add a zero to the remainder making it 620, and continue the process.

Moving on to step 16:
620 divided by 507 is 1 with a remainder of 113.
Record the quotient 1 as the next digit in the result. 
Result so far: 79235.02761341
Deduct 507 from 620 and we're left with 113.
Since there are no more digits in the dividend, we add a zero to the remainder making it 1130, and continue the process.

The final result is 79235.02761341 with a remainder of 1.13e-07.