Long division

In arithmetic, long division is a standard division algorithm suitable for dividing multi-digit numbers that is simple enough to perform by hand. It breaks down a division problem into a series of easier steps.
As in all division problems, one number, called the dividend, is divided by another, called the divisor, producing a result called the quotient. It enables computations involving arbitrarily large numbers to be performed by following a series of simple steps. The abbreviated form of long division is called short division, which is almost always used instead of long division when the divisor has only one digit. Chunking (also known as the partial quotients method or the hangman method) is a less mechanical form of long division prominent in the UK which contributes to a more holistic understanding about the division process.
While related algorithms have existed since the 12th century AD, the specific algorithm in modern use was introduced by Henry Briggs 1600 AD.
Place in education.
Inexpensive calculators and computers have become the most common way to solve division problems, eliminating a traditional mathematical exercise, and decreasing the educational opportunity to show how to do so by paper and pencil techniques. (Internally, those devices use one of a variety of division algorithms, the faster ones among which rely on approximations and multiplications to achieve the tasks). In the United States, long division has been especially targeted for de-emphasis, or even elimination from the school curriculum, by reform mathematics, though traditionally introduced in the 4th or 5th grades.
Method.
In English-speaking countries, long division does not use the division slash or division sign symbols but instead constructs a tableau. The divisor is separated from the dividend by a right parenthesis or vertical bar ; the dividend is separated from the quotient by a vinculum (i.e., an overbar). The combination of these two symbols is sometimes known as a long division symbol or division bracket. It developed in the 18th century from an earlier single-line notation separating the dividend from the quotient by a left parenthesis.
The process is begun by dividing the left-most digit of the dividend by the divisor. The quotient (rounded down to an integer) becomes the first digit of the result, and the remainder is calculated (this step is notated as a subtraction). This remainder carries forward when the process is repeated on the following digit of the dividend (notated as 'bringing down' the next digit to the remainder). When all digits have been processed and no remainder is left, the process is complete.
An example is shown below, representing the division of 500 by 4 (with a result of 125).
 125 (Explanations)
 4)500
 4 ( 4 × 1 = 4)
 10 ( 5 - 4 = 1)
 8 ( 4 × 2 = 8)
 20 (10 - 8 = 2)
 20 ( 4 × 5 = 20)
 0 (20 - 20 = 0)
A more detailed breakdown of the steps goes as follows:
If the last remainder when we ran out of dividend digits had been something other than 0, there would have been two possible courses of action:
 31.75 
 4)127.00
 12 (12 ÷ 4 = 3)
 07 (0 remainder, bring down next figure)
 4 (7 ÷ 4 = 1 r 3) 
 3.0 (bring down 0 and the decimal point)
 2.8 (7 × 4 = 28, 30 ÷ 4 = 7 r 2)
 20 (an additional zero is brought down)
 20 (5 × 4 = 20)
 0
In this example, the decimal part of the result is calculated by continuing the process beyond the units digit, "bringing down" zeros as being the decimal part of the dividend.
This example also illustrates that, at the beginning of the process, a step that produces a zero can be omitted. Since the first digit 1 is less than the divisor 4, the first step is instead performed on the first two digits 12. Similarly, if the divisor were 13, one would perform the first step on 127 rather than 12 or 1.
Invariant property and correctness.
The basic presentation of the steps of the process (above)
focus on the "what" steps are to be performed,
rather than the "properties of those steps" that ensure the result will be correct
(specifically, that "q × m + r = n", where "q" is the final quotient and "r" the final remainder).
A slight variation of presentation requires more writing,
and requires that we change, rather than just update, digits of the quotient,
but can shed more light on "why" these steps actually produce the right answer
by allowing evaluation of "q × m + r" at intermediate points in the process.
This illustrates the key property used in the derivation of the algorithm 
(below).
Specifically, we amend the above basic procedure so that
we fill the space after the digits of the "quotient" under construction with 0's, to at least the 1's place,
and include those 0's in the numbers we write below the division bracket.
This lets us maintain an invariant relation at every step:
"q × m + r = n", where "q" is the partially-constructed quotient (above the division bracket)
and "r" the partially-constructed remainder (bottom number below the division bracket).
Note that, initially "q=0" and "r=n", so this property holds initially;
the process reduces r and increases q with each step,
eventually stopping when "r<m" if we seek the answer in quotient + integer remainder form.
Revisiting the "500 ÷ 4" example above, we find
 125 ("q", changes from 000 to 100 to 120 to 125 as per notes below)
 4)500
 400 ( 4 × 100 = 400)
 100 (500 - 400 = 100; now "q=100", "r=100"; note "q×4+r = 500".)
 80 ( 4 × 20 = 80)
 20 (100 - 80 = 20; now "q=120", "r= 20"; note "q×4+r = 500".)
 20 ( 4 × 5 = 20)
 0 ( 20 - 20 = 0; now "q=125", "r= 0"; note "q×4+r = 500".)
Example with multi-digit divisor.
A divisor of any number of digits can be used. In this example, 1260257 is to be divided by 37. First the problem is set up as follows:
 37)1260257
Digits of the number 1260257 are taken until a number greater than or equal to 37 occurs. So 1 and 12 are less than 37, but 126 is greater. Next, the greatest multiple of 37 less than or equal to 126 is computed. So 3 × 37 = 111 < 126, but 4 × 37 > 126. The multiple 111 is written underneath the 126 and the 3 is written on the top where the solution will appear:
 3 
 37)1260257
 111
Note carefully which place-value column these digits are written into. The 3 in the quotient goes in the same column (ten-thousands place) as the 6 in the dividend 1260257, which is the same column as the last digit of 111.
The 111 is then subtracted from the line above, ignoring all digits to the right:
 3 
 37)1260257
 111
 15
Now the digit from the next smaller place value of the dividend is copied down and appended to the result 15:
 3 
 37)1260257
 111
 150
The process repeats: the greatest multiple of 37 less than or equal to 150 is subtracted. This is 148 = 4 × 37, so a 4 is added to the top as the next quotient digit. Then the result of the subtraction is extended by another digit taken from the dividend:
 34 
 37)1260257
 111
 150
 148
 22
The greatest multiple of 37 less than or equal to 22 is 0 × 37 = 0. Subtracting 0 from 22 gives 22, we often don't write the subtraction step. Instead, we simply take another digit from the dividend:
 340 
 37)1260257
 111
 150
 148
 225
The process is repeated until 37 divides the last line exactly:
 34061
 37)1260257
 111
 150
 148
 225
 222
 37
Mixed mode long division.
For non-decimal currencies (such as the British £sd system before 1971) and measures (such as avoirdupois) mixed mode division must be used. Consider dividing 50 miles 600 yards into 37 pieces:
 mi - yd - ft - in
 1 - 634 1 9 r. 15"
 37) 50 - 600 - 0 - 0
 37 22880 66 348
 13 23480 66 348
 1760 222 37 333
 22880 128 29 15
 ===== 111 348 ==
 170 ===
 148
 22
 66
Each of the four columns is worked in turn. Starting with the miles: 50/37 = 1 remainder 13. No further division is
possible, so perform a long multiplication by 1,760 to convert miles to yards, the result is 22,880 yards. Carry this to the top of the yards column and add it to the 600 yards in the dividend giving 23,480. Long division of 23,480 / 37 now proceeds as normal yielding 634 with remainder 22. The remainder is multiplied by 3 to get feet and carried up to the feet column. Long division of the feet gives 1 remainder 29 which is then multiplied by twelve to get 348 inches. Long division continues with the final remainder of 15 inches being shown on the result line.
Interpretation of decimal results.
When the quotient is not an integer and the division process is extended beyond the decimal point, one of two things can happen:
Notation in non-English-speaking countries.
China, Japan, Korea use the same notation as English-speaking nations including India. Elsewhere, the same general principles are used, but the figures are often arranged differently.
Latin America.
In Latin America (except Argentina, Bolivia, Mexico, Colombia, Paraguay, Venezuela, Uruguay and Brazil), the calculation is almost exactly the same, but is written down differently as shown below with the same two examples used above. Usually the quotient is written under a bar drawn under the divisor. A long vertical line is sometimes drawn to the right of the calculations.
 500 ÷ 4 = 125 (Explanations) 
 4 ( 4 × 1 = 4)
 10 ( 5 - 4 = 1)
 8 ( 4 × 2 = 8)
 20 (10 - 8 = 2)
 20 ( 4 × 5 = 20)
 0 (20 - 20 = 0)
and
 127 ÷ 4 = 31.75
 124 
 30 (bring down 0; decimal to quotient)
 28 (7 × 4 = 28)
 20 (an additional zero is added)
 20 (5 × 4 = 20)
 0
In Mexico, the English-speaking world notation is used, except that only the result of the subtraction is annotated and the calculation is done mentally, as shown below:
 125 (Explanations)
 4)500
 10 ( 5 - 4 = 1)
 20 (10 - 8 = 2)
 0 (20 - 20 = 0)
In Bolivia, Brazil, Paraguay, Venezuela, Canada, Colombia, and Peru, the European notation (see below) is used, except that the quotient is not separated by a vertical line, as shown below:
 127|4 
 −124 31,75
 30
 −28
 20
 −20
 0
Same procedure applies in Mexico, Uruguay and Argentina, only the result of the subtraction is annotated and the calculation is done mentally.
Eurasia.
In Spain, Italy, France, Portugal, Lithuania, Romania, Turkey, Greece, Belgium, Belarus, Ukraine, and Russia, the divisor is to the right of the dividend, and separated by a vertical bar. The division also occurs in the column, but the quotient (result) is written below the divider, and separated by the horizontal line. The same method is used in Iran, Vietnam and Mongolia.
 127|4 
 −124|31,75
 30
 −28
 20
 −20
 0
In Cyprus, as well as in France, a long vertical bar separates the dividend and subsequent subtractions from the quotient and divisor, as in the below of 6359 divided by 17, which is 374 with a remainder of 1.
Decimal numbers are not divided directly, the dividend and divisor are multiplied by a power of ten so that the division involves two whole numbers. Therefore, if one were dividing 12,7 by 0,4 (commas being used instead of decimal points), the dividend and divisor would first be changed to 127 and 4, and then the division would proceed as above.
In Austria, Germany and Switzerland, the notational form of a normal equation is used. <dividend> : <divisor> = <quotient>, with the colon ":" denoting a binary infix symbol for the division operator (analogous to "/" or "÷"). In these regions the decimal separator is written as a comma. (cf. first section of Latin American countries above, where it's done virtually the same way):
 127 : 4 = 31,75
 −12
 07
 −4
 30
 −28
 20
 −20
 0
The same notation is adopted in Denmark, Norway, Bulgaria, North Macedonia, Poland, Croatia, Slovenia, Hungary, Czech Republic, Slovakia, Vietnam and in Serbia.
In the Netherlands, the following notation is used:
 12 / 135 \ 11,25
 12
 15
 12
 30
 24
 60
 60
 0
Algorithm for arbitrary base.
Every natural number formula_1 can be uniquely represented in an arbitrary number base formula_2 as a sequence of digits formula_3 where formula_4, where formula_5 is the number of digits in formula_1. The value of formula_1 in terms of its digits and the base is
Let formula_1 be the dividend and formula_10 be the divisor, where formula_11 is the number of digits in formula_10. If formula_13, then formula_14 and formula_15. Otherwise, we iterate from formula_16, before stopping.
For each iteration formula_17, let formula_18 be the quotient extracted so far, formula_19 be the intermediate dividend, formula_20 be the intermediate remainder, formula_21 be the next digit of the original dividend, and formula_22 be the next digit of the quotient. By definition of digits in base formula_23, formula_24. All values are natural numbers. We initiate 
the first formula_27 digits of formula_1.
With every iteration, the three equations are true:
There only exists one such formula_22 such that formula_33.
The final quotient is formula_34 and the final remainder is formula_35
Examples.
In base 10, using the example above with formula_36 and formula_37, the initial values formula_38 and formula_39.
Thus, formula_40 and formula_41.
In base 16, with formula_42 and formula_43, the initial values are formula_38 and formula_45.
Thus, formula_46 and formula_47.
If one doesn't have the addition, subtraction, or multiplication tables for base memorised, then this algorithm still works if the numbers are converted to decimal and at the end are converted back to base . For example, with the above example, 
and 
with formula_50. The initial values are formula_38 and formula_52.
Thus, formula_53 and formula_54.
This algorithm can be done using the same kind of pencil-and-paper notations as shown in above sections.
 d8f45 r. 5
 12 ) f412df
 ea
 a1
 90
 112
 10e
 4d
 48
 5f
 5a
 5
Rational quotients.
If the quotient is not constrained to be an integer, then the algorithm does not terminate for formula_55. Instead, if formula_55 then formula_57 by definition. If the remainder formula_20 is equal to zero at any iteration, then the quotient is a formula_23-adic fraction, and is represented as a finite decimal expansion in base formula_23 positional notation. Otherwise, it is still a rational number but not a formula_23-adic rational, and is instead represented as an infinite repeating decimal expansion in base formula_23 positional notation.
Binary division.
Calculation within the binary number system is simpler, because each digit in the course can only be 1 or 0 - no multiplication is needed as multiplication by either results in the same number or zero.
If this were on a computer, multiplication by 10 can be represented by a bit shift of 1 to the left, and finding formula_22 reduces down to the logical operation formula_64, where true = 1 and false = 0. With every iteration formula_16, the following operations are done:
For example, with formula_67 and formula_68, the initial values are formula_38 and formula_70.
Thus, formula_71 and formula_72.
Performance.
On each iteration, the most time-consuming task is to select formula_22. We know that there are formula_23 possible values, so we can find formula_22 using formula_76 comparisons. Each comparison will require evaluating formula_77. Let formula_5 be the number of digits in the dividend formula_1 and formula_11 be the number of digits in the divisor formula_10. The number of digits in formula_82. The multiplication of formula_83 is therefore formula_84, and likewise the subtraction of formula_77. Thus it takes formula_86 to select formula_22. The remainder of the algorithm are addition and the digit-shifting of formula_18 and formula_20 to the left one digit, and so takes time formula_90 and formula_84 in base formula_23, so each iteration takes formula_93, or just formula_94. For all formula_95 digits, the algorithm takes time formula_96, or formula_97 in base formula_23.
Generalizations.
Rational numbers.
Long division of integers can easily be extended to include non-integer dividends, as long as they are rational. This is because every rational number has a recurring decimal expansion. The procedure can also be extended to include divisors which have a finite or terminating decimal expansion (i.e. decimal fractions). In this case the procedure involves multiplying the divisor and dividend by the appropriate power of ten so that the new divisor is an integer – taking advantage of the fact that "a" ÷ "b" = ("ca") ÷ ("cb") – and then proceeding as above.
Polynomials.
A generalised version of this method called polynomial long division is also used for dividing polynomials (sometimes using a shorthand version called synthetic division).