|
In mathematics, the result of the division of two integers usually cannot be expressed with an integer quotient, unless a remainder —an amount "left over"— is also acknowledged.
Common definition
For division involving non-negative integers, the most common way of defining remainder, as stated by the division algorithm theorem, is as follows:
If a and d are integers, with a being a non-negative number and d positive, it can be proved that there exist unique integers q and r, such that a=q×d+r and 0≤ r < d. The number q is called the quotient, while r is called the remainder.
Examples
- When dividing 13 by 10, one gets 1 as the quotient and 3 as the remainder, because 13=1×10+3.
- When dividing 26 by 4, one gets 6 as the quotient and 2 as the remainder, because 26=6×4+2.
- When dividing 56 by 7, one gets 8 as the quotient and 0 as the remainder, because 56=7×8+0.
The case of general integers
Remainder must be defined slightly differently when either a, or d, or both are negative:
If a and d are integers, with d non-zero, then a remainder is an integer r such that a=q×d+r for some integer q, and with 0≤ |r| < |d|.
When defined this way, there are two possible remainders. For example, when dividing −42 by −5 one can either do
- −42=9×(−5)+3
or
- −42=8×(−5)+(−2).
So the remainder is then either 3 or −2.
This ambiguity in the value of the remainder is not very serious; in the case above, the negative remainder is obtained from the positive one just by subtracting 5, which is d. This holds in general. When dividing by d, if the positive remainder is r1, and the negative one is r2, then
- r1=r2+d.
Other definitions
In the definitions above, the quotient and remainder are intentionally constrained such that q×d is as close to a as possible, as this minimizes the number of valid quotients, and is most desirable in everyday applications of mathematics.
However, division, in general, allows remainders to be defined without these particular constraints. For example, given less restrictive bounds, when dividing 26 by 4, one could determine that 5 is a valid quotient and 6 is the corresponding remainder, because 26=5×4+6.
In mathematics, such definitions are considered to be more of a theoretical exercise; normally only the Division Algorithm's definition of remainder is of any practical use, and is thus considered the default. Therefore, more generalized applications of division that involve remainders other than 0≤r<d, such as the modulo operation in computing, are obligated to specify what constraints are in effect.
The remainder can be defined for division involving real numbers too, provided the quotient is required to be an integer. More precisely, if a and d are real numbers, with d non-zero, then there exists a unique integer quotient q and a unique real remainder r such that a=q×d+r with 0≤r<|d|. The modulo operation in computing observes this principle.
See also
|