Long Division
   HOME

TheInfoList



OR:

In
arithmetic Arithmetic is an elementary branch of mathematics that deals with numerical operations like addition, subtraction, multiplication, and division. In a wider sense, it also includes exponentiation, extraction of roots, and taking logarithms. ...
, long division is a standard
division algorithm A division algorithm is an algorithm which, given two integers ''N'' and ''D'' (respectively the numerator and the denominator), computes their quotient and/or remainder, the result of Euclidean division. Some are applied by hand, while others ar ...
suitable for dividing multi-digit Hindu-Arabic numerals (
positional notation Positional notation, also known as place-value notation, positional numeral system, or simply place value, usually denotes the extension to any radix, base of the Hindu–Arabic numeral system (or decimal, decimal system). More generally, a posit ...
) 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 A dividend is a distribution of profits by a corporation to its shareholders, after which the stock exchange decreases the price of the stock by the dividend to remove volatility. The market has no control over the stock price on open on the ex ...
, is divided by another, called the
divisor In mathematics, a divisor of an integer n, also called a factor of n, is an integer m that may be multiplied by some integer to produce n. In this case, one also says that n is a '' multiple'' of m. An integer n is divisible or evenly divisibl ...
, 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.


History

Related algorithms have existed since the 12th century. Al-Samawal al-Maghribi (1125–1174) performed calculations with decimal numbers that essentially require long division, leading to infinite decimal results, but without formalizing the algorithm. Caldrini (1491) is the earliest printed example of long division, known as the ''Danda'' method in medieval Italy, and it became more practical with the introduction of decimal notation for fractions by Pitiscus (1608). The specific algorithm in modern use was introduced by Henry Briggs 1600.


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 algorithm A division algorithm is an algorithm which, given two integers ''N'' and ''D'' (respectively the numerator and the denominator), computes their quotient and/or remainder, the result of Euclidean division. Some are applied by hand, while others ar ...
s, the faster of which rely on approximations and multiplications to achieve the tasks.) In North America, long division has been especially targeted for de-emphasis or even elimination from the school curriculum by
reform mathematics Reform refers to the improvement or amendment of what is wrong, corrupt, unsatisfactory, etc. The modern usage of the word emerged in the late 18th century and is believed to have originated from Christopher Wyvill (reformer), Christopher Wyvill's ...
, though it has been traditionally introduced in the 4th, 5th or even 6th grades.


Method

In English-speaking countries, long division does not use the division slash or
division sign The division sign () is a mathematical symbol consisting of a short horizontal line with a dot above and another dot below, used in Anglophone countries to indicate the operation of division. This usage is not universal and the symbol has d ...
symbols but instead constructs a tableau. The
divisor In mathematics, a divisor of an integer n, also called a factor of n, is an integer m that may be multiplied by some integer to produce n. In this case, one also says that n is a '' multiple'' of m. An integer n is divisible or evenly divisibl ...
is separated from the dividend by a right parenthesis or
vertical bar The vertical bar, , is a glyph with various uses in mathematics, computing, and typography. It has many names, often related to particular meanings: Sheffer stroke (in logic), pipe, bar, or (literally, the word "or"), vbar, and others. Usage ...
; 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 In mathematics, the remainder is the amount "left over" after performing some computation. In arithmetic, the remainder is the integer "left over" after dividing one integer by another to produce an integer quotient ( integer division). In a ...
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: # Find the shortest sequence of digits starting from the left end of the dividend, 500, that the divisor 4 goes into at least once. In this case, this is simply the first digit, 5. The largest number that the divisor 4 can be multiplied by without exceeding 5 is 1, so the digit 1 is put above the 5 to start constructing the quotient. # Next, the 1 is multiplied by the divisor 4, to obtain the largest whole number that is a multiple of the divisor 4 without exceeding the 5 (4 in this case). This 4 is then placed under and subtracted from the 5 to get the remainder, 1, which is placed under the 4 under the 5. # Afterwards, the first as-yet unused digit in the dividend, in this case the first digit 0 after the 5, is copied directly underneath itself and next to the remainder 1, to form the number 10. # At this point the process is repeated enough times to reach a stopping point: The largest number by which the divisor 4 can be multiplied without exceeding 10 is 2, so 2 is written above as the second leftmost quotient digit. This 2 is then multiplied by the divisor 4 to get 8, which is the largest multiple of 4 that does not exceed 10; so 8 is written below 10, and the subtraction 10 minus 8 is performed to get the remainder 2, which is placed below the 8. # The next digit of the dividend (the last 0 in 500) is copied directly below itself and next to the remainder 2 to form 20. Then the largest number by which the divisor 4 can be multiplied without exceeding 20, which is 5, is placed above as the third leftmost quotient digit. This 5 is multiplied by the divisor 4 to get 20, which is written below and subtracted from the existing 20 to yield the remainder 0, which is then written below the second 20. # At this point, since there are no more digits to bring down from the dividend and the last subtraction result was 0, we can be assured that the process finished. 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: # We could just stop there and say that the dividend divided by the divisor is the quotient written at the top with the remainder written at the bottom, and write the answer as the quotient followed by a fraction that is the remainder divided by the divisor. # We could extend the dividend by writing it as, say, 500.000... and continue the process (using a decimal point in the quotient directly above the decimal point in the dividend), in order to get a decimal answer, as in the following example. 31.75 4)127.00 12 (12 ÷ 4 = 3) 07 (0
remainder In mathematics, the remainder is the amount "left over" after performing some computation. In arithmetic, the remainder is the integer "left over" after dividing one integer by another to produce an integer quotient ( integer division). In a ...
, 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.


Basic procedure for long division of

# Find the location of all decimal points in the dividend and divisor . # If necessary, simplify the long division problem by moving the decimals of the divisor and dividend by the same number of decimal places, to the right (or to the left), so that the decimal of the divisor is to the right of the last digit. # When doing long division, keep the numbers lined up straight from top to bottom under the tableau. # After each step, be sure the remainder for that step is less than the divisor. If it is not, there are three possible problems: the multiplication is wrong, the subtraction is wrong, or a greater quotient is needed. # In the end, the remainder, , is added to the growing quotient as a
fraction A fraction (from , "broken") represents a part of a whole or, more generally, any number of equal parts. When spoken in everyday English, a fraction describes how many parts of a certain size there are, for example, one-half, eight-fifths, thre ...
, .


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 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 file:Guildhall Museum Collection- Drusilla Dunford Money Table Sampler 3304.JPG, A Sampler (needlework), sampler in the Rochester Guildhall, Guildhall Museum of Rochester, Medway, Rochester illustrates the conversion between pence and shillings ...
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: # The process can terminate, which means that a remainder of 0 is reached; or # A remainder could be reached that is identical to a previous remainder that occurred after the decimal points were written. In the latter case, continuing the process would be pointless, because from that point onward the same sequence of digits would appear in the quotient over and over. So a bar is drawn over the repeating sequence to indicate that it repeats forever (i.e., every rational number is either a terminating or repeating decimal).


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 Latin America is the cultural region of the Americas where Romance languages are predominantly spoken, primarily Spanish language, Spanish and Portuguese language, Portuguese. Latin America is defined according to cultural identity, not geogr ...
(except
Argentina Argentina, officially the Argentine Republic, is a country in the southern half of South America. It covers an area of , making it the List of South American countries by area, second-largest country in South America after Brazil, the fourt ...
,
Bolivia Bolivia, officially the Plurinational State of Bolivia, is a landlocked country located in central South America. The country features diverse geography, including vast Amazonian plains, tropical lowlands, mountains, the Gran Chaco Province, w ...
,
Mexico Mexico, officially the United Mexican States, is a country in North America. It is the northernmost country in Latin America, and borders the United States to the north, and Guatemala and Belize to the southeast; while having maritime boundar ...
,
Colombia Colombia, officially the Republic of Colombia, is a country primarily located in South America with Insular region of Colombia, insular regions in North America. The Colombian mainland is bordered by the Caribbean Sea to the north, Venezuel ...
,
Paraguay Paraguay, officially the Republic of Paraguay, is a landlocked country in South America. It is bordered by Argentina to the Argentina–Paraguay border, south and southwest, Brazil to the Brazil–Paraguay border, east and northeast, and Boli ...
,
Venezuela Venezuela, officially the Bolivarian Republic of Venezuela, is a country on the northern coast of South America, consisting of a continental landmass and many Federal Dependencies of Venezuela, islands and islets in the Caribbean Sea. It com ...
,
Uruguay Uruguay, officially the Oriental Republic of Uruguay, is a country in South America. It shares borders with Argentina to its west and southwest and Brazil to its north and northeast, while bordering the Río de la Plata to the south and the A ...
and
Brazil Brazil, officially the Federative Republic of Brazil, is the largest country in South America. It is the world's List of countries and dependencies by area, fifth-largest country by area and the List of countries and dependencies by population ...
), 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 Mexico, officially the United Mexican States, is a country in North America. It is the northernmost country in Latin America, and borders the United States to the north, and Guatemala and Belize to the southeast; while having maritime boundar ...
, 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 Bolivia, officially the Plurinational State of Bolivia, is a landlocked country located in central South America. The country features diverse geography, including vast Amazonian plains, tropical lowlands, mountains, the Gran Chaco Province, w ...
,
Brazil Brazil, officially the Federative Republic of Brazil, is the largest country in South America. It is the world's List of countries and dependencies by area, fifth-largest country by area and the List of countries and dependencies by population ...
,
Paraguay Paraguay, officially the Republic of Paraguay, is a landlocked country in South America. It is bordered by Argentina to the Argentina–Paraguay border, south and southwest, Brazil to the Brazil–Paraguay border, east and northeast, and Boli ...
,
Venezuela Venezuela, officially the Bolivarian Republic of Venezuela, is a country on the northern coast of South America, consisting of a continental landmass and many Federal Dependencies of Venezuela, islands and islets in the Caribbean Sea. It com ...
, French-speaking Canada,
Colombia Colombia, officially the Republic of Colombia, is a country primarily located in South America with Insular region of Colombia, insular regions in North America. The Colombian mainland is bordered by the Caribbean Sea to the north, Venezuel ...
, and
Peru Peru, officially the Republic of Peru, is a country in western South America. It is bordered in the north by Ecuador and Colombia, in the east by Brazil, in the southeast by Bolivia, in the south by Chile, and in the south and west by the Pac ...
, 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 Mexico, officially the United Mexican States, is a country in North America. It is the northernmost country in Latin America, and borders the United States to the north, and Guatemala and Belize to the southeast; while having maritime boundar ...
,
Uruguay Uruguay, officially the Oriental Republic of Uruguay, is a country in South America. It shares borders with Argentina to its west and southwest and Brazil to its north and northeast, while bordering the Río de la Plata to the south and the A ...
and
Argentina Argentina, officially the Argentine Republic, is a country in the southern half of South America. It covers an area of , making it the List of South American countries by area, second-largest country in South America after Brazil, the fourt ...
, 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
example Example may refer to: * ''exempli gratia'' (e.g.), usually read out in English as "for example" * .example, reserved as a domain name that may not be installed as a top-level domain of the Internet ** example.com, example.net, example.org, an ...
below of 6359 divided by 17, which is 374 with a remainder of 1. 6359, 17 −51 , 374 125 , −119 , 69, −68, 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 Austria, formally the Republic of Austria, is a landlocked country in Central Europe, lying in the Eastern Alps. It is a federation of nine Federal states of Austria, states, of which the capital Vienna is the List of largest cities in Aust ...
,
Germany Germany, officially the Federal Republic of Germany, is a country in Central Europe. It lies between the Baltic Sea and the North Sea to the north and the Alps to the south. Its sixteen States of Germany, constituent states have a total popu ...
and
Switzerland Switzerland, officially the Swiss Confederation, is a landlocked country located in west-central Europe. It is bordered by Italy to the south, France to the west, Germany to the north, and Austria and Liechtenstein to the east. 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 Denmark is a Nordic countries, Nordic country in Northern Europe. It is the metropole and most populous constituent of the Kingdom of Denmark,, . also known as the Danish Realm, a constitutionally unitary state that includes the Autonomous a ...
,
Norway Norway, officially the Kingdom of Norway, is a Nordic countries, Nordic country located on the Scandinavian Peninsula in Northern Europe. The remote Arctic island of Jan Mayen and the archipelago of Svalbard also form part of the Kingdom of ...
,
Bulgaria Bulgaria, officially the Republic of Bulgaria, is a country in Southeast Europe. It is situated on the eastern portion of the Balkans directly south of the Danube river and west of the Black Sea. Bulgaria is bordered by Greece and Turkey t ...
,
North Macedonia North Macedonia, officially the Republic of North Macedonia, is a landlocked country in Southeast Europe. It shares land borders with Greece to the south, Albania to the west, Bulgaria to the east, Kosovo to the northwest and Serbia to the n ...
,
Poland Poland, officially the Republic of Poland, is a country in Central Europe. It extends from the Baltic Sea in the north to the Sudetes and Carpathian Mountains in the south, bordered by Lithuania and Russia to the northeast, Belarus and Ukrai ...
,
Croatia Croatia, officially the Republic of Croatia, is a country in Central Europe, Central and Southeast Europe, on the coast of the Adriatic Sea. It borders Slovenia to the northwest, Hungary to the northeast, Serbia to the east, Bosnia and Herze ...
,
Slovenia Slovenia, officially the Republic of Slovenia, is a country in Central Europe. It borders Italy to the west, Austria to the north, Hungary to the northeast, Croatia to the south and southeast, and a short (46.6 km) coastline within the Adriati ...
,
Hungary Hungary is a landlocked country in Central Europe. Spanning much of the Pannonian Basin, Carpathian Basin, it is bordered by Slovakia to the north, Ukraine to the northeast, Romania to the east and southeast, Serbia to the south, Croatia and ...
,
Czech Republic The Czech Republic, also known as Czechia, and historically known as Bohemia, is a landlocked country in Central Europe. The country is bordered by Austria to the south, Germany to the west, Poland to the northeast, and Slovakia to the south ...
,
Slovakia Slovakia, officially the Slovak Republic, is a landlocked country in Central Europe. It is bordered by Poland to the north, Ukraine to the east, Hungary to the south, Austria to the west, and the Czech Republic to the northwest. Slovakia's m ...
,
Vietnam Vietnam, officially the Socialist Republic of Vietnam (SRV), is a country at the eastern edge of mainland Southeast Asia, with an area of about and a population of over 100 million, making it the world's List of countries and depende ...
and in
Serbia , image_flag = Flag of Serbia.svg , national_motto = , image_coat = Coat of arms of Serbia.svg , national_anthem = () , image_map = , map_caption = Location of Serbia (gree ...
. In the
Netherlands , Terminology of the Low Countries, informally Holland, is a country in Northwestern Europe, with Caribbean Netherlands, overseas territories in the Caribbean. It is the largest of the four constituent countries of the Kingdom of the Nether ...
, the following notation is used: 12 / 135 \ 11,25 12 15 12 30 24 60 60 0 In
Finland Finland, officially the Republic of Finland, is a Nordic country in Northern Europe. It borders Sweden to the northwest, Norway to the north, and Russia to the east, with the Gulf of Bothnia to the west and the Gulf of Finland to the south, ...
, the Italian method detailed above was replaced by the Anglo-American one in the 1970s. In the early 2000s, however, some textbooks have adopted the German method as it retains the order between the divisor and the dividend.Ikäheimo, Hannele
Jakolaskuun ymmärrystä
(''in Finnish'')


Algorithm for arbitrary base

Every
natural number In mathematics, the natural numbers are the numbers 0, 1, 2, 3, and so on, possibly excluding 0. Some start counting with 0, defining the natural numbers as the non-negative integers , while others start with 1, defining them as the positive in ...
n can be uniquely represented in an arbitrary number base b>1 as a
sequence In mathematics, a sequence is an enumerated collection of objects in which repetitions are allowed and order matters. Like a set, it contains members (also called ''elements'', or ''terms''). The number of elements (possibly infinite) is cal ...
of digits n=\alpha_\alpha_\alpha_...\alpha_ where 0\leq\alpha_ for all 0\leq i, where k is the number of digits in n. The value of n in terms of its digits and the base is :n=\sum_^\alpha_b^ Let n be the dividend and m be the divisor, where l is the number of digits in m. If k < l, then quotient q = 0 and remainder r = n. Otherwise, we iterate from 0 \leq i \leq k - l, before stopping. For each
iteration Iteration is the repetition of a process in order to generate a (possibly unbounded) sequence of outcomes. Each repetition of the process is a single iteration, and the outcome of each iteration is then the starting point of the next iteration. ...
i, let q_ be the quotient extracted so far, d_ be the intermediate dividend, r_ be the intermediate remainder, \alpha_ be the next digit of the original dividend, and \beta_ be the next digit of the quotient. By definition of digits in base b, 0\leq\beta_. By definition of remainder, 0\leq r_. All values are natural numbers. We initiate :q_=0 :r_=\sum_^\alpha_b^ the first l-1 digits of n. With every iteration, the three equations are true: :d_=br_+\alpha_ :r_=d_-m\beta_=br_+\alpha_-m\beta_ :q_=bq_+\beta_ There only exists one such \beta_ such that 0\leq r_. The final quotient is q = q_ and the final remainder is r = r_


Examples

In
base 10 The decimal numeral system (also called the base-ten positional numeral system and denary or decanary) is the standard system for denoting integer and non-integer numbers. It is the extension to non-integer numbers (''decimal fractions'') of t ...
, using the example above with n = 1260257 and m = 37, the initial values q_ = 0 and r_ = 1. Thus, q = 34061 and r = 0. In base 16, with n = \text and m = 12, the initial values are q_ = 0 and r_ = \text. Thus, q = \text and r = \text. If one doesn't have the
addition Addition (usually signified by the Plus and minus signs#Plus sign, plus symbol, +) is one of the four basic Operation (mathematics), operations of arithmetic, the other three being subtraction, multiplication, and Division (mathematics), divis ...
, subtraction, or multiplication tables for base memorised, then this algorithm still works if the numbers are converted to
decimal The decimal numeral system (also called the base-ten positional numeral system and denary or decanary) is the standard system for denoting integer and non-integer numbers. It is the extension to non-integer numbers (''decimal fractions'') of th ...
and at the end are converted back to base . For example, with the above example, :n = \text_ = 15 \cdot 16^5 + 4 \cdot 16^4 + 1 \cdot 16^3 + 2 \cdot 16^2 + 13 \cdot 16^1 + 15 \cdot 16^0 and :m = \text_ = 1 \cdot 16^1 + 2 \cdot 16^0 = 18 with b = 16. The initial values are q_ = 0 and r_ = 15. Thus, q = 16^4 \cdot 13 + 16^3 \cdot 8 + 16^2 \cdot 15 + 16^1 \cdot 4 + 5 = \text_ and r = 5 = \text_. 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 i>k-l. Instead, if i>k-l then \alpha_=0 by definition. If the remainder r_ is equal to zero at any iteration, then the quotient is a b-adic fraction, and is represented as a
finite decimal A decimal representation of a non-negative real number is its expression as a sequence of symbols consisting of decimal digits traditionally written with a single separator: r = b_k b_\cdots b_0.a_1a_2\cdots Here is the decimal separator, is ...
expansion in base b positional notation. Otherwise, it is still a
rational number In mathematics, a rational number is a number that can be expressed as the quotient or fraction of two integers, a numerator and a non-zero denominator . For example, is a rational number, as is every integer (for example, The set of all ...
but not a b-adic rational, and is instead represented as an infinite
repeating decimal A repeating decimal or recurring decimal is a decimal representation of a number whose digits are eventually periodic (that is, after some place, the same sequence of digits is repeated forever); if this sequence consists only of zeros (that i ...
expansion in base b positional notation.


Binary division


Performance

On each iteration, the most time-consuming task is to select \beta_. We know that there are b possible values, so we can find \beta_ using O(\log(b)) comparisons. Each comparison will require evaluating d_-m\beta_. Let k be the number of digits in the dividend n and l be the number of digits in the divisor m. The number of digits in d_ \leq l + 1. The multiplication of m\beta_ is therefore O(l), and likewise the subtraction of d_-m\beta_. Thus it takes O(l\log(b)) to select \beta_. The remainder of the algorithm are addition and the digit-shifting of q_ and r_ to the left one digit, and so takes time O(k) and O(l) in base b, so each iteration takes O(l\log(b) + k + l), or just O(l\log(b) + k). For all k - l + 1 digits, the algorithm takes time O((k - l + 1)(l\log(b) + k)), or O(kl\log(b) + k^2) in base b.


Generalizations


Rational numbers

Long division of integers can easily be extended to include non-integer dividends, as long as they are
rational Rationality is the quality of being guided by or based on reason. In this regard, a person acts rationally if they have a good reason for what they do, or a belief is rational if it is based on strong evidence. This quality can apply to an ...
. 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 The decimal numeral system (also called the base-ten positional numeral system and denary or decanary) is the standard system for denoting integer and non-integer numbers. It is the extension to non-integer numbers (''decimal fractions'') of th ...
expansion (i.e.
decimal fraction The decimal numeral system (also called the base-ten positional numeral system and denary or decanary) is the standard system for denoting integer and non-integer numbers. It is the extension to non-integer numbers (''decimal fractions'') of the ...
s). 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
polynomial In mathematics, a polynomial is a Expression (mathematics), mathematical expression consisting of indeterminate (variable), indeterminates (also called variable (mathematics), variables) and coefficients, that involves only the operations of addit ...
s (sometimes using a shorthand version called synthetic division).


See also

*
Algorism Algorism is the technique of performing basic arithmetic by writing numbers in place value form and applying a set of memorized rules and facts to the digits. One who practices algorism is known as an algorist. This positional notation system ...
*
Arbitrary-precision arithmetic In computer science, arbitrary-precision arithmetic, also called bignum arithmetic, multiple-precision arithmetic, or sometimes infinite-precision arithmetic, indicates that calculations are performed on numbers whose digits of precision are po ...
* Egyptian multiplication and division *
Elementary arithmetic Elementary arithmetic is a branch of mathematics involving addition, subtraction, multiplication, and Division (mathematics), division. Due to its low level of abstraction, broad range of application, and position as the foundation of all mathema ...
* Fourier division * Polynomial long division * Short division


References


External links


Long Division Algorithm

Long Division and Euclid's Lemma
{{Number-theoretic algorithms Algorithms Computer arithmetic algorithms Digit-by-digit algorithms Division (mathematics)