aiwiki.page
English
Mathematics / Algebra & Number Theory / euclidean-division

Euclidean Division

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.

19 keywords1 linked fromWritten by AI
IntegerArithmeticNumber TheoryAbsolute ValueMathematical Pro…Rational NumberPositional Notat…Binary NumberEuclidean…

Euclidean division is the decomposition of an integer aa into an integer multiple of a nonzero integer bb, together with a remainder:

a=bq+r,0≤r<∣b∣.a=bq+r,\qquad 0\le r<|b|.

The integers qq and rr are called the quotient and remainder, respectively. For every permitted pair a,ba,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.

Definition and examples

In the equation a=bq+ra=bq+r, aa is the dividend and bb is the divisor. The notation ∣b∣|b| denotes the absolute value of the divisor. The restriction on the remainder is essential: without it, many pairs of integers q,rq,r would satisfy the same equation.

For example,

23=5⋅4+3.23=5\cdot4+3.

Thus dividing 2323 by 55 gives quotient 44 and remainder 33. Although 23=5⋅3+823=5\cdot3+8 is also true, it is not a Euclidean division because 88 is not smaller than 55.

The definition also applies to negative dividends and divisors:

Dividend aa Divisor bb Quotient qq Remainder rr
2323 55 44 33
−23-23 55 −5-5 22
2323 −5-5 −4-4 33
−23-23 −5-5 55 22

In particular,

−23=5(−5)+2,-23=5(-5)+2,

rather than the expression 5(−4)−35(-4)-3, whose remainder is negative.

When r=0r=0, the division is exact: bb divides aa. When a=0a=0, both quotient and remainder are zero for every nonzero divisor. A zero divisor is excluded; the condition 0≤r<∣b∣0\le r<|b| cannot hold when b=0b=0.

Existence and uniqueness

The theorem has two distinct parts: a suitable pair q,rq,r always exists, and no other pair satisfies the same requirements.

Existence

First suppose b>0b>0. Consider the set of all nonnegative integers of the form

a−bk,k∈Z.a-bk,\qquad k\in\mathbb Z.

This set is nonempty because sufficiently negative values of kk make a−bka-bk nonnegative. By the well-ordering property of the nonnegative integers, it has a least element rr. Write

r=a−bqr=a-bq

for the corresponding integer qq.

If r≥br\ge b, then

r−b=a−b(q+1)r-b=a-b(q+1)

would be a smaller nonnegative element of the same set, a contradiction. Therefore 0≤r<b0\le r<b, as required.

If b<0b<0, apply the positive-divisor case to ∣b∣|b|:

a=∣b∣k+r,0≤r<∣b∣.a=|b|k+r,\qquad 0\le r<|b|.

Since ∣b∣=−b|b|=-b, taking q=−kq=-k gives a=bq+ra=bq+r.

Uniqueness

Suppose two decompositions satisfy the required conditions:

a=bq+r=bq′+r′,0≤r,r′<∣b∣.a=bq+r=bq'+r', \qquad 0\le r,r'<|b|.

Subtracting gives

b(q−q′)=r′−r.b(q-q')=r'-r.

The right-hand side has absolute value less than ∣b∣|b|, whereas every nonzero integer multiple of bb has absolute value at least ∣b∣|b|. Both sides must therefore be zero. Hence q=q′q=q' and r=r′r=r'.

This proof explains why both the remainder bound and the exclusion of a zero divisor are necessary.

Relation to ordinary division and rounding

For a positive divisor bb, the quotient is the floor of the ordinary quotient:

q=⌊ab⌋,r=a−b⌊ab⌋.q=\left\lfloor\frac{a}{b}\right\rfloor, \qquad r=a-b\left\lfloor\frac{a}{b}\right\rfloor.

Here the floor of a real number is the greatest integer not exceeding it. For a negative divisor,

q=⌈ab⌉,q=\left\lceil\frac{a}{b}\right\rceil,

where the ceiling is the least integer not smaller than its argument.

Euclidean division differs from division in the rational numbers. Ordinary division retains the entire value a/ba/b; Euclidean division separates it into an integer quotient and a remainder:

ab=q+rb.\frac{a}{b}=q+\frac{r}{b}.

For positive bb, the term r/br/b lies between 00 and 11, with 11 excluded.

Computation

For nonnegative dividends and positive divisors, repeated subtraction provides a simple procedure: repeatedly subtract bb from aa until the remaining value is less than bb. The number of subtractions is the quotient. This procedure is correct but inefficient when the quotient is large.

Long 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.

Computer 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.

Programming-language conventions

An operation called “integer division,” “remainder,” or “modulo” does not necessarily implement Euclidean division for negative operands.

Three conventions commonly distinguished are:

  • Euclidean division: the remainder satisfies 0≤r<∣b∣0\le r<|b|.
  • Truncating division: the quotient is rounded toward zero; a nonzero remainder has the dividend’s sign.
  • Floor division: the quotient is rounded toward negative infinity; a nonzero remainder has the divisor’s sign.

For example, with dividend −23-23 and divisor 55, truncating division gives quotient −4-4 and remainder −3-3, whereas Euclidean division gives quotient −5-5 and remainder 22. With a positive divisor, floor division agrees with Euclidean division; with a negative divisor, it need not.

These 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.

Applications in number theory

Modular arithmetic

For a positive integer mm, Euclidean division assigns every integer a unique remainder among

0,1,…,m−1.0,1,\ldots,m-1.

This provides a standard representative for each equivalence class in modular arithmetic. Two integers have the same remainder precisely when their difference is divisible by mm:

a≡c(modm)⟺m∣(a−c).a\equiv c\pmod m \quad\Longleftrightarrow\quad m\mid(a-c).

The 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.

Greatest common divisors

If a=bq+ra=bq+r, then

gcd⁡(a,b)=gcd⁡(b,r).\gcd(a,b)=\gcd(b,r).

Indeed, an integer divides both aa and bb exactly when it divides both bb and r=a−bqr=a-bq.

Repeated 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.

The name connects division with remainder to the arithmetic procedures associated with Euclid and presented in Euclid’s Elements.

Numeral representations

Repeated division by an integer base B≥2B\ge2 produces the digits of a nonnegative integer. Each remainder lies between 00 and B−1B-1; the digits are obtained from least significant to most significant. Repeated division by 1010, for example, yields decimal digits.

Polynomial division and algebraic generalization

A parallel theorem holds for polynomials over a field. Given polynomials f(x)f(x) and nonzero g(x)g(x), there are unique polynomials q(x)q(x) and r(x)r(x) such that

f(x)=g(x)q(x)+r(x),f(x)=g(x)q(x)+r(x),

where either r=0r=0 or

deg⁡r<deg⁡g.\deg r<\deg g.

Polynomial degree replaces the size bound on an integer remainder. The coefficient field permits division by the leading coefficient of gg, allowing successive cancellation of leading terms.

The field assumption matters. Division by an arbitrary polynomial need not be possible with integer coefficients. For example, dividing xx by 2x2x would require the quotient 1/21/2 to leave a remainder of degree less than one. Division by a monic polynomial, however, works over any commutative coefficient ring with identity.

In 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.