Built and fact-checked by the DocNectar team — see our editorial standards
Key Features
Instant Calculation
Get accurate results in real time with our optimized algorithm.
Mobile Friendly
Fully responsive design. Works on all devices & screen sizes.
Privacy Focused
Your data stays on your device. We don't store any inputs.
100% Free
No hidden costs. This tool is completely free forever.
Floor division rounds the result of a division down to the nearest integer (toward negative infinity), which differs from simple truncating division whenever negative numbers are involved. This tool calculates the correct floor-division quotient and remainder for any integers.
How it works
Floor division computes ⌊a/b⌋ — the quotient rounded toward negative infinity, not toward zero. The remainder is then a minus the quotient times b, which for floor division always has the same sign as the divisor.
- Enter dividend (a).
- Enter divisor (b).
- Click Calculate to see your results.
Examples
A negative dividend
−7 divided by 2: truncating division gives −3 (rounding toward zero), but floor division gives −4, since −4 is the largest integer that is ≤ −3.5. The remainder is −7 − (−4×2) = 1.
Who should use it
- Computer science and programming exercises involving modular arithmetic.
- Verifying floor-division behavior across different programming languages.
Industry applications
- Computer science and software engineering
- Mathematics education (number theory)
Advantages
- Correctly implements true floor division for all sign combinations.
- Shows both the quotient and matching remainder.
Limitations
- Only supports integer inputs — not general real-number floor division.
Common mistakes to avoid
- Assuming a programming language's built-in integer division always performs floor division — many languages (including PHP's intdiv) truncate toward zero instead.
Best practices
- When working with negative numbers in division-heavy code, explicitly verify whether floor division or truncating division is required, since they diverge for mixed-sign operands.
Tips
- If your remainder is negative but your divisor is positive, you're likely using truncating division somewhere instead of true floor division.