{
  "id": "euclidean-division",
  "title": "Euclidean Division",
  "lang": "en",
  "source_lang": "en",
  "summary": "Euclidean division expresses an integer as a multiple of a nonzero divisor plus a uniquely determined nonnegative remainder smaller than the divisor’s absolute value.",
  "category": "mathematics",
  "subcategory": "algebra",
  "type": "concept",
  "aliases": [
    "Division with remainder",
    "Integer division with remainder",
    "Division algorithm"
  ],
  "generated_at": "2026-11-05",
  "model": "pro/gpt-6.1-sol",
  "url": "https://aiwiki.page/en/euclidean-division/",
  "translations": {
    "zh-Hans": {
      "url": "https://aiwiki.page/zh/euclidean-division/",
      "json": "https://aiwiki.page/zh/euclidean-division.json"
    }
  },
  "sections": [
    {
      "heading": "",
      "text": "Euclidean division is the decomposition of an integer \\(a\\) into an integer multiple of a nonzero integer \\(b\\), together with a remainder:\n\n\\[a=bq+r,\\qquad 0\\le r<|b|.\\]\n\nThe integers \\(q\\) and \\(r\\) are called the quotient and remainder, respectively. For every permitted pair \\(a,b\\), they exist and are unique. This statement, often called the division algorithm, is a foundational result in arithmetic and number theory. Despite the traditional name, the theorem specifies the result of division rather than a particular procedure for computing it."
    },
    {
      "heading": "Definition and examples",
      "text": "In the equation \\(a=bq+r\\), \\(a\\) is the dividend and \\(b\\) is the divisor. The notation \\(|b|\\) denotes the absolute value of the divisor. The restriction on the remainder is essential: without it, many pairs of integers \\(q,r\\) would satisfy the same equation.\n\nFor example,\n\n\\[23=5\\cdot4+3.\\]\n\nThus dividing \\(23\\) by \\(5\\) gives quotient \\(4\\) and remainder \\(3\\). Although \\(23=5\\cdot3+8\\) is also true, it is not a Euclidean division because \\(8\\) is not smaller than \\(5\\).\n\nThe definition also applies to negative dividends and divisors:\n\nDividend \\(a\\) | Divisor \\(b\\) | Quotient \\(q\\) | Remainder \\(r\\)\n\\(23\\) | \\(5\\) | \\(4\\) | \\(3\\)\n\\(-23\\) | \\(5\\) | \\(-5\\) | \\(2\\)\n\\(23\\) | \\(-5\\) | \\(-4\\) | \\(3\\)\n\\(-23\\) | \\(-5\\) | \\(5\\) | \\(2\\)\n\nIn particular,\n\n\\[-23=5(-5)+2,\\]\n\nrather than the expression \\(5(-4)-3\\), whose remainder is negative.\n\nWhen \\(r=0\\), the division is exact: \\(b\\) divides \\(a\\). When \\(a=0\\), both quotient and remainder are zero for every nonzero divisor. A zero divisor is excluded; the condition \\(0\\le r<|b|\\) cannot hold when \\(b=0\\)."
    },
    {
      "heading": "Existence and uniqueness",
      "text": "The theorem has two distinct parts: a suitable pair \\(q,r\\) always exists, and no other pair satisfies the same requirements.\n\nExistence\n\nFirst suppose \\(b>0\\). Consider the set of all nonnegative integers of the form\n\n\\[a-bk,\\qquad k\\in\\mathbb Z.\\]\n\nThis set is nonempty because sufficiently negative values of \\(k\\) make \\(a-bk\\) nonnegative. By the well-ordering property of the nonnegative integers, it has a least element \\(r\\). Write\n\n\\[r=a-bq\\]\n\nfor the corresponding integer \\(q\\).\n\nIf \\(r\\ge b\\), then\n\n\\[r-b=a-b(q+1)\\]\n\nwould be a smaller nonnegative element of the same set, a contradiction. Therefore \\(0\\le r<b\\), as required.\n\nIf \\(b<0\\), apply the positive-divisor case to \\(|b|\\):\n\n\\[a=|b|k+r,\\qquad 0\\le r<|b|.\\]\n\nSince \\(|b|=-b\\), taking \\(q=-k\\) gives \\(a=bq+r\\).\n\nUniqueness\n\nSuppose two decompositions satisfy the required conditions:\n\n\\[a=bq+r=bq'+r', \\qquad 0\\le r,r'<|b|.\\]\n\nSubtracting gives\n\n\\[b(q-q')=r'-r.\\]\n\nThe right-hand side has absolute value less than \\(|b|\\), whereas every nonzero integer multiple of \\(b\\) has absolute value at least \\(|b|\\). Both sides must therefore be zero. Hence \\(q=q'\\) and \\(r=r'\\).\n\nThis proof explains why both the remainder bound and the exclusion of a zero divisor are necessary."
    },
    {
      "heading": "Relation to ordinary division and rounding",
      "text": "For a positive divisor \\(b\\), the quotient is the floor of the ordinary quotient:\n\n\\[q=\\left\\lfloor\\frac{a}{b}\\right\\rfloor, \\qquad r=a-b\\left\\lfloor\\frac{a}{b}\\right\\rfloor.\\]\n\nHere the floor of a real number is the greatest integer not exceeding it. For a negative divisor,\n\n\\[q=\\left\\lceil\\frac{a}{b}\\right\\rceil,\\]\n\nwhere the ceiling is the least integer not smaller than its argument.\n\nEuclidean division differs from division in the rational numbers. Ordinary division retains the entire value \\(a/b\\); Euclidean division separates it into an integer quotient and a remainder:\n\n\\[\\frac{a}{b}=q+\\frac{r}{b}.\\]\n\nFor positive \\(b\\), the term \\(r/b\\) lies between \\(0\\) and \\(1\\), with \\(1\\) excluded."
    },
    {
      "heading": "Computation",
      "text": "For nonnegative dividends and positive divisors, repeated subtraction provides a simple procedure: repeatedly subtract \\(b\\) from \\(a\\) until the remaining value is less than \\(b\\). The number of subtractions is the quotient. This procedure is correct but inefficient when the quotient is large.\n\nLong division instead processes the digits of a number in positional notation. At each stage, a partial dividend is divided by the divisor, producing a quotient digit and a smaller remainder. Binary long division uses the same principle with binary digits.\n\nComputer implementations use various algorithms, depending on operand size and hardware. For large integers, efficient division can use approximation and fast multiplication, followed by correction steps that ensure the exact quotient and remainder conditions.\n\nProgramming-language conventions\n\nAn operation called “integer division,” “remainder,” or “modulo” does not necessarily implement Euclidean division for negative operands.\n\nThree conventions commonly distinguished are:\n\n- Euclidean division: the remainder satisfies \\(0\\le r<|b|\\).\n- Truncating division: the quotient is rounded toward zero; a nonzero remainder has the dividend’s sign.\n- Floor division: the quotient is rounded toward negative infinity; a nonzero remainder has the divisor’s sign.\n\nFor example, with dividend \\(-23\\) and divisor \\(5\\), truncating division gives quotient \\(-4\\) and remainder \\(-3\\), whereas Euclidean division gives quotient \\(-5\\) and remainder \\(2\\). With a positive divisor, floor division agrees with Euclidean division; with a negative divisor, it need not.\n\nThese distinctions matter in indexing, cyclic calculations, and implementations of number-theoretic algorithms. Floating-point arithmetic introduces separate rounding considerations and should not be assumed to reproduce exact integer division merely by rounding a floating-point quotient."
    },
    {
      "heading": "Applications in number theory",
      "text": "Modular arithmetic\n\nFor a positive integer \\(m\\), Euclidean division assigns every integer a unique remainder among\n\n\\[0,1,\\ldots,m-1.\\]\n\nThis provides a standard representative for each equivalence class in modular arithmetic. Two integers have the same remainder precisely when their difference is divisible by \\(m\\):\n\n\\[a\\equiv c\\pmod m \\quad\\Longleftrightarrow\\quad m\\mid(a-c).\\]\n\nThe representative is an ordinary integer, while the congruence class contains infinitely many integers. Distinguishing these objects clarifies the difference between taking a remainder and working with congruences.\n\nGreatest common divisors\n\nIf \\(a=bq+r\\), then\n\n\\[\\gcd(a,b)=\\gcd(b,r).\\]\n\nIndeed, an integer divides both \\(a\\) and \\(b\\) exactly when it divides both \\(b\\) and \\(r=a-bq\\).\n\nRepeated Euclidean division is therefore the basis of the Euclidean algorithm for finding the greatest common divisor. With positive divisors, successive nonzero remainders strictly decrease, so the process terminates. The last nonzero remainder is the greatest common divisor.\n\nThe name connects division with remainder to the arithmetic procedures associated with Euclid and presented in Euclid’s Elements.\n\nNumeral representations\n\nRepeated division by an integer base \\(B\\ge2\\) produces the digits of a nonnegative integer. Each remainder lies between \\(0\\) and \\(B-1\\); the digits are obtained from least significant to most significant. Repeated division by \\(10\\), for example, yields decimal digits."
    },
    {
      "heading": "Polynomial division and algebraic generalization",
      "text": "A parallel theorem holds for polynomials over a field. Given polynomials \\(f(x)\\) and nonzero \\(g(x)\\), there are unique polynomials \\(q(x)\\) and \\(r(x)\\) such that\n\n\\[f(x)=g(x)q(x)+r(x),\\]\n\nwhere either \\(r=0\\) or\n\n\\[\\deg r<\\deg g.\\]\n\nPolynomial degree replaces the size bound on an integer remainder. The coefficient field permits division by the leading coefficient of \\(g\\), allowing successive cancellation of leading terms.\n\nThe field assumption matters. Division by an arbitrary polynomial need not be possible with integer coefficients. For example, dividing \\(x\\) by \\(2x\\) would require the quotient \\(1/2\\) to leave a remainder of degree less than one. Division by a monic polynomial, however, works over any commutative coefficient ring with identity.\n\nIn abstract algebra, a Euclidean domain is an integral domain equipped with a size function on its nonzero elements that permits division with a remainder of smaller size, or remainder zero. The integers and polynomial rings over fields are standard examples. In general Euclidean domains, the size condition need not make quotient and remainder unique; that uniqueness is an additional feature of the familiar integer and polynomial versions."
    }
  ],
  "links": [
    "integer",
    "arithmetic",
    "number-theory",
    "absolute-value",
    "mathematical-proof",
    "rational-number",
    "positional-notation",
    "binary-number",
    "algorithm",
    "floating-point-arithmetic",
    "equivalence-class",
    "modular-arithmetic",
    "euclidean-algorithm",
    "greatest-common-divisor",
    "euclid",
    "euclids-elements",
    "polynomial",
    "field-mathematics",
    "abstract-algebra"
  ],
  "sources": [],
  "license": "https://creativecommons.org/licenses/by/4.0/"
}