What Is Floor Division?
Floor division divides one number by another and rounds the result down to the nearest integer that is less than or equal to the exact quotient. It is written as a // b in many programming languages such as Python. Unlike normal division, which can produce a decimal, floor division always returns a whole number. This calculator computes both the floor quotient and the corresponding remainder for any two numbers you enter.
How to Use It
Enter the dividend (the number being divided, a) and the divisor (the number you divide by, b). Click calculate to see the floor quotient and the remainder. The divisor cannot be zero. The calculator works with both positive and negative inputs and follows the convention that the result is rounded toward negative infinity.
The Formula Explained
The core formula is \(\left\lfloor \frac{a}{b} \right\rfloor\), the largest integer that is less than or equal to the exact value of a/b. The remainder is then defined as $$r = a - b \times \left\lfloor \frac{a}{b} \right\rfloor$$ Because the quotient rounds down rather than toward zero, negative numbers behave predictably: for example -7 // 2 = -4 rather than -3, and the remainder stays non-negative when the divisor is positive.
Worked Example
Suppose a = 17 and b = 5. The exact quotient is 3.4. The floor of 3.4 is 3, so the floor quotient is 3. The remainder is $$17 - 5 \times 3 = 17 - 15 = 2$$ So 17 // 5 = 3 with a remainder of 2.
FAQ
How is floor division different from integer division? For positive numbers they match. They differ for negatives: integer (truncated) division rounds toward zero, while floor division rounds toward negative infinity.
Can the divisor be zero? No. Division by zero is undefined, so the calculator requires a non-zero divisor.
What is the remainder used for? Together the quotient and remainder reconstruct the original number: \(a = b \times \text{quotient} + \text{remainder}\), which is useful in modular arithmetic and clock-style calculations.