40317917 divided by 789 
Our goal is to divide 40317917 by 789.

Step 1:
789 can be fit into 4 0 times, resulting in a remainder of 4.
Write down 0 as next digit of the result. 
Result so far: 0.0
Subtracting 0 from 4 leaves us with 4.
Include the next digit (0) from the dividend after 4, then repeat: 40 / 789

Step 2:
789 can be fit into 40 0 times, resulting in a remainder of 40.
Use 0 as the next digit of our solution. 
Result so far: 0.0
If we subtract 0 from 40, we get 40.
Bring next digit (3) of the dividend behind the 40 and repeat the process: 403 / 789

On to step 3:
The number 789 fits into 403 0 times, leaving a remainder of 403.
The number 0 becomes the next digit in our result. 
Result so far: 0.0
The remainder is 403 after subtracting 0 from 403.
Take the next digit (1) from the dividend and append it to 403, then repeat: 4031 / 789

On to step 4:
If we divide 4031 by 789, we get 5 and a remainder of 86.
Write down 5 as next digit of the result. 
Result so far: 5.0
Deduct 3945 from 4031 and we're left with 86.
Grab the next digit (7) from the dividend, add it to 86, then carry on: 867 / 789

Advancing to step 5:
When dividing 867 by 789, we get 1 with a remainder of 78.
Write down 1 as next digit of the result. 
Result so far: 51.0
If we subtract 789 from 867, we get 78.
Take the next digit (9) from the dividend and append it to 78, then repeat: 789 / 789

Going ahead to step 6:
If we divide 789 by 789, we get 1 and a remainder of 0.
Write down 1 as next digit of the result. 
Result so far: 511.0
If we take 789 away from 789, we end up with 0.
Fetch the next digit (1) from the dividend, attach it to 0 and continue: 1 / 789

On to step 7:
When dividing 1 by 789, we get 0 with a remainder of 1.
Use 0 as the next digit of our solution. 
Result so far: 5110.0
If we take 0 away from 1, we end up with 1.
Include the next digit (7) from the dividend after 1, then repeat: 17 / 789

Moving on to step 8:
17 divided by 789 is 0 with a remainder of 17.
Put 0 as the next digit of the answer. 
Result so far: 51100.0
If we take 0 away from 17, we end up with 17.
Since there are no more digits in the dividend, we add a zero to the remainder making it 170, and continue the process.

Moving on to step 9:
789 can be fit into 170 0 times, resulting in a remainder of 170.
The next digit of our result is 0. 
Result so far: 51100.0
If we take 0 away from 170, we end up with 170.
Since there are no more digits in the dividend, we add a zero to the remainder making it 1700, and continue the process.

Going ahead to step 10:
If we divide 1700 by 789, we get 2 and a remainder of 122.
Use 2 as the next digit of our solution. 
Result so far: 51100.02
If we subtract 1578 from 1700, we get 122.
Since there are no more digits in the dividend, we add a zero to the remainder making it 1220, and continue the process.

Going ahead to step 11:
When dividing 1220 by 789, we get 1 with a remainder of 431.
The next digit of our result is 1. 
Result so far: 51100.021
Deduct 789 from 1220 and we're left with 431.
Since there are no more digits in the dividend, we add a zero to the remainder making it 4310, and continue the process.

On to step 12:
The number 789 fits into 4310 5 times, leaving a remainder of 365.
The number 5 becomes the next digit in our result. 
Result so far: 51100.0215
Subtracting 3945 from 4310 leaves us with 365.
Since there are no more digits in the dividend, we add a zero to the remainder making it 3650, and continue the process.

On to step 13:
3650 divided by 789 is 4 with a remainder of 494.
Put 4 as the next digit of the answer. 
Result so far: 51100.02154
If we take 3156 away from 3650, we end up with 494.
Since there are no more digits in the dividend, we add a zero to the remainder making it 4940, and continue the process.

Advancing to step 14:
When dividing 4940 by 789, we get 6 with a remainder of 206.
Record the quotient 6 as the next digit in the result. 
Result so far: 51100.021546
Subtract 4734 from 4940 to get 206.
Since there are no more digits in the dividend, we add a zero to the remainder making it 2060, and continue the process.

Step 15:
If we divide 2060 by 789, we get 2 and a remainder of 482.
The number 2 becomes the next digit in our result. 
Result so far: 51100.0215462
If we subtract 1578 from 2060, we get 482.
Since there are no more digits in the dividend, we add a zero to the remainder making it 4820, and continue the process.

Step 16:
4820 divided by 789 is 6 with a remainder of 86.
Put 6 as the next digit of the answer. 
Result so far: 51100.02154626
The remainder is 86 after subtracting 4734 from 4820.
Since there are no more digits in the dividend, we add a zero to the remainder making it 860, and continue the process.

The quotient of the division is 51100.02154626, and the remainder is 8.6e-08.