Skip to main content
MBA Compass Logo
MBA Compassby B School Buzz
arithmetic

Division algorithm (quotient and remainder)

intermediate
High weightage
CAT
XAT
NMAT
SNAP
CMAT
IIFT
MAT
a = b \cdot q + r, \quad 0 \le r < b, \quad q = \left\lfloor \frac{a}{b} \right\rfloor, \quad r = a - b \cdot \left\lfloor \frac{a}{b} \right\rfloor
This fundamental lemma (division algorithm) expresses any integer a (unit: integer) divided by positive integer b (b>0) as a product bq plus remainder r with 0r < b. Here q is the integer quotient and r is the remainder. The formula q = gives the greatest integer not exceeding the true division a/b, and r is the leftover a - bq. Intuitively you partition a into b-sized blocks (q full blocks) and one partial block of size r. Algebraically this canonical representation is unique for given a and positive b. Edge cases: if b=1 then q=a and r=0; if a is negative the standard floor-based definition still applies but one must be careful about sign conventions — many problems restrict to a,b nonnegative. Domain restrictions: b must be positive integer; for real divisors the notion of integer quotient needs adaptation.

Related formulas