Calculate the floor quotient and corresponding remainder for positive or negative numbers.
Integer floor division
Enter a dividend and nonzero divisor to apply the division algorithm.
About floor division
Floor division divides one number by another and rounds the quotient downward to the nearest integer. The word downward is important: the result moves toward negative infinity, not merely toward zero. For 17 divided by 5, the ordinary quotient is 3.4 and the floor quotient is 3. For -17 divided by 5, the ordinary quotient is -3.4 and the floor quotient is -4. This calculator applies that mathematical definition consistently to positive and negative inputs.
Along with the quotient, the calculator reports a remainder that satisfies the division identity: dividend equals divisor times quotient plus remainder. After finding the floor quotient q, it computes the remainder r as dividend minus divisor times q. For 17 and 5, that produces q equal to 3 and r equal to 2. For -17 and 5, it produces q equal to -4 and r equal to 3. In both cases, substituting the displayed values reconstructs the original dividend exactly.
Floor division appears frequently in programming. It is useful for splitting a total into complete groups, converting a flat array index into row and column coordinates, dividing elapsed seconds into whole minutes, paginating records, and implementing modular arithmetic. Languages do not all treat division of negative values the same way. Python's double-slash operator follows floor division, while truncating integer division in some other languages moves toward zero. That difference affects both quotient and remainder signs.
The divisor must never be zero because division by zero has no finite mathematical result. Decimal inputs are allowed because the floor operation is defined for real quotients, although many everyday applications use integers. Floating-point arithmetic can have small representation limitations for long decimals, so use sensible precision when checking decimal identities.
When the divisor is positive, the floor-division remainder is nonnegative and smaller than the divisor. With a negative divisor, the remainder is nonpositive and greater than the divisor. This sign behavior follows directly from choosing the quotient by flooring the real division result. The displayed identity makes it easy to verify every answer and distinguish floor division from truncation or ordinary rounded division.
Floor division examples
Division
Result
Explanation
17 divided by 5
Quotient 3, remainder 2
Five fits into seventeen three complete times.
-17 divided by 5
Quotient -4, remainder 3
Flooring -3.4 moves downward to -4.
20 divided by 4
Quotient 5, remainder 0
Exact division leaves no remainder.
How to calculate floor division
Enter the dividend, which is the number being divided.
Enter a nonzero divisor.
Select Calculate Floor Division to find the floor quotient and remainder.
Check the displayed identity to verify that the values reconstruct the dividend.
Floor division FAQ
How is floor division different from regular division?
Regular division can return a decimal quotient. Floor division returns the greatest integer less than or equal to that quotient and also provides a remainder.
Why does -17 divided by 5 give -4 instead of -3?
The floor of -3.4 is -4 because flooring moves toward negative infinity. Returning -3 would be truncation toward zero, which is a different rule.
How is the remainder calculated?
The remainder equals the dividend minus the divisor times the floor quotient. This ensures the quotient and remainder always satisfy the division identity.
Can the divisor be negative?
Yes, any finite nonzero divisor is accepted. With a negative divisor, the remainder follows the divisor's sign under floor-division rules.
Why is division by zero rejected?
No number multiplied by zero can reconstruct a nonzero dividend. Division by zero is therefore undefined and cannot produce a valid quotient or remainder.