We're dividing 31510138 by 798 
Let's see how many times 798 fits into 31510138.

Going ahead to step 1:
When dividing 3 by 798, we get 0 with a remainder of 3.
The next digit of our result is 0. 
Result so far: 0.0
Deduct 0 from 3 and we're left with 3.
Fetch the next digit (1) from the dividend, attach it to 3 and continue: 31 / 798

Moving on to step 2:
If we divide 31 by 798, we get 0 and a remainder of 31.
Put 0 as the next digit of the answer. 
Result so far: 0.0
If we subtract 0 from 31, we get 31.
Include the next digit (5) from the dividend after 31, then repeat: 315 / 798

Advancing to step 3:
The number 798 fits into 315 0 times, leaving a remainder of 315.
The next digit of our result is 0. 
Result so far: 0.0
Subtract 0 from 315 to get 315.
Take the next digit (1) from the dividend and append it to 315, then repeat: 3151 / 798

Let's proceed to step 4:
If we divide 3151 by 798, we get 3 and a remainder of 757.
The number 3 becomes the next digit in our result. 
Result so far: 3.0
Deduct 2394 from 3151 and we're left with 757.
Take the next digit (0) from the dividend and append it to 757, then repeat: 7570 / 798

Going ahead to step 5:
798 can be fit into 7570 9 times, resulting in a remainder of 388.
Write down 9 as next digit of the result. 
Result so far: 39.0
Subtracting 7182 from 7570 leaves us with 388.
Bring next digit (1) of the dividend behind the 388 and repeat the process: 3881 / 798

On to step 6:
If we divide 3881 by 798, we get 4 and a remainder of 689.
Put 4 as the next digit of the answer. 
Result so far: 394.0
The remainder is 689 after subtracting 3192 from 3881.
Fetch the next digit (3) from the dividend, attach it to 689 and continue: 6893 / 798

On to step 7:
The number 798 fits into 6893 8 times, leaving a remainder of 509.
The next digit of our result is 8. 
Result so far: 3948.0
If we subtract 6384 from 6893, we get 509.
Append the next digit (8) from the dividend to 509 and continue with: 5098 / 798

On to step 8:
The number 798 fits into 5098 6 times, leaving a remainder of 310.
Write down 6 as next digit of the result. 
Result so far: 39486.0
Deduct 4788 from 5098 and we're left with 310.
Since there are no more digits in the dividend, we add a zero to the remainder making it 3100, and continue the process.

Let's proceed to step 9:
3100 divided by 798 is 3 with a remainder of 706.
The number 3 becomes the next digit in our result. 
Result so far: 39486.3
Subtract 2394 from 3100 to get 706.
Since there are no more digits in the dividend, we add a zero to the remainder making it 7060, and continue the process.

Going ahead to step 10:
798 goes into 7060 8 times with a remainder of 676.
Write down 8 as next digit of the result. 
Result so far: 39486.38
The remainder is 676 after subtracting 6384 from 7060.
Since there are no more digits in the dividend, we add a zero to the remainder making it 6760, and continue the process.

On to step 11:
6760 divided by 798 is 8 with a remainder of 376.
Record the quotient 8 as the next digit in the result. 
Result so far: 39486.388
The remainder is 376 after subtracting 6384 from 6760.
Since there are no more digits in the dividend, we add a zero to the remainder making it 3760, and continue the process.

The final result is 39486.388 with a remainder of 0.0376.