We're dividing 40027122 by 797 
We're looking to find how many times 797 goes into 40027122.

Advancing to step 1:
When dividing 4 by 797, we get 0 with a remainder of 4.
Record the quotient 0 as the next digit in the result. 
Result so far: 0.0
Subtract 0 from 4 to get 4.
Bring next digit (0) of the dividend behind the 4 and repeat the process: 40 / 797

Step 2:
The number 797 fits into 40 0 times, leaving a remainder of 40.
Write down 0 as next digit of the result. 
Result so far: 0.0
The remainder is 40 after subtracting 0 from 40.
Bring next digit (0) of the dividend behind the 40 and repeat the process: 400 / 797

Moving on to step 3:
797 goes into 400 0 times with a remainder of 400.
Record the quotient 0 as the next digit in the result. 
Result so far: 0.0
The remainder is 400 after subtracting 0 from 400.
Bring next digit (2) of the dividend behind the 400 and repeat the process: 4002 / 797

Moving on to step 4:
797 goes into 4002 5 times with a remainder of 17.
Put 5 as the next digit of the answer. 
Result so far: 5.0
If we subtract 3985 from 4002, we get 17.
Append the next digit (7) from the dividend to 17 and continue with: 177 / 797

Moving on to step 5:
177 divided by 797 is 0 with a remainder of 177.
Use 0 as the next digit of our solution. 
Result so far: 50.0
Deduct 0 from 177 and we're left with 177.
Include the next digit (1) from the dividend after 177, then repeat: 1771 / 797

Going ahead to step 6:
When dividing 1771 by 797, we get 2 with a remainder of 177.
The next digit of our result is 2. 
Result so far: 502.0
If we subtract 1594 from 1771, we get 177.
Append the next digit (2) from the dividend to 177 and continue with: 1772 / 797

Let's proceed to step 7:
If we divide 1772 by 797, we get 2 and a remainder of 178.
Record the quotient 2 as the next digit in the result. 
Result so far: 5022.0
Subtracting 1594 from 1772 leaves us with 178.
Take the next digit (2) from the dividend and append it to 178, then repeat: 1782 / 797

Let's proceed to step 8:
The number 797 fits into 1782 2 times, leaving a remainder of 188.
Write down 2 as next digit of the result. 
Result so far: 50222.0
Subtract 1594 from 1782 to get 188.
Since there are no more digits in the dividend, we add a zero to the remainder making it 1880, and continue the process.

Let's proceed to step 9:
When dividing 1880 by 797, we get 2 with a remainder of 286.
The next digit of our result is 2. 
Result so far: 50222.2
Subtracting 1594 from 1880 leaves us with 286.
Since there are no more digits in the dividend, we add a zero to the remainder making it 2860, and continue the process.

Going ahead to step 10:
797 can be fit into 2860 3 times, resulting in a remainder of 469.
Record the quotient 3 as the next digit in the result. 
Result so far: 50222.23
If we subtract 2391 from 2860, we get 469.
Since there are no more digits in the dividend, we add a zero to the remainder making it 4690, and continue the process.

Advancing to step 11:
797 goes into 4690 5 times with a remainder of 705.
Use 5 as the next digit of our solution. 
Result so far: 50222.235
Deduct 3985 from 4690 and we're left with 705.
Since there are no more digits in the dividend, we add a zero to the remainder making it 7050, and continue the process.

Step 12:
If we divide 7050 by 797, we get 8 and a remainder of 674.
Use 8 as the next digit of our solution. 
Result so far: 50222.2358
Subtracting 6376 from 7050 leaves us with 674.
Since there are no more digits in the dividend, we add a zero to the remainder making it 6740, and continue the process.

Step 13:
797 goes into 6740 8 times with a remainder of 364.
Write down 8 as next digit of the result. 
Result so far: 50222.23588
Subtract 6376 from 6740 to get 364.
Since there are no more digits in the dividend, we add a zero to the remainder making it 3640, and continue the process.

The quotient of the division is 50222.23588, and the remainder is 0.000364.