[Go to site: main page, start]

TOPICS
Search

Integer Division


Integer division is division in which the fractional part is discarded. For a nonnegative integer a and a positive integer b, it returns a quotient q and remainder r. The remainder satisfies 0<=r<b, and the two values are characterized by

q=|_a/b_|
(1)
r=a-bq.
(2)

The quotient is sometimes denoted a\b. For example, 10/3=3+1/3, whereas 10\3=3.

For large integers, division can be reduced to multiplication using a whole shifted inverse. Given an integer base B>1 and h such that a<=B^h, Watt (2023) showed that for some delta in {0,1},

 q=|_a/b_|=|_(a|_B^h/b_|)/(B^h)_|+delta.
(3)

Thus multiplication by |_B^h/b_|, followed by a base-B shift, gives either the quotient or one less than the quotient. The remainder is then r=a-bq.

Integer division is implemented in the Wolfram Language as Quotient[a, b].


See also

Backslash, Quotient, Remainder, Whole Shifted Inverse

Explore with Wolfram|Alpha

References

Watt, S. M. "Efficient Generic Quotients Using Exact Arithmetic." In International Symposium on Symbolic and Algebraic Computation 2023 (ISSAC 2023). New York: ACM, pp. 535-544, 2023. https://doi.org/10.1145/3597066.3597076.

Referenced on Wolfram|Alpha

Integer Division

Cite this as:

Weisstein, Eric W. "Integer Division." From MathWorld--A Wolfram Resource. https://mathworld.wolfram.com/IntegerDivision.html

Subject classifications