Math July 13, 2026 · 8 Min Read

Floor Division Calculator – Guide & Formulas

Calculate floor division of two integers. Get the quotient, remainder, and floor result of any integer division operation with step-by-step explanation.

Calculate floor division of two integers to get the quotient and remainder. Enter any dividend and divisor to see the floor result, remainder, and step-by-step breakdown.

Key Takeaway

Use the free Floor Division Calculator to calculate floor division of two integers. get the quotient, remainder, and floor result of any integer division operation with step-by-step explanation. Get instant results with step-by-step explanations.

How to Use the Floor Division Calculator

  1. Enter the Dividend (the number being divided).
  2. Enter the Divisor (the number dividing into the dividend).
  3. Review the floor division result (quotient rounded toward negative infinity).
  4. Check the remainder (modulus) of the division.
  5. Observe the difference between floor division and truncation for negative numbers.

The Formula

Floor Division: q = ⌊a/b⌋ is the quotient rounded toward negative infinity. Remainder: r = a - b × q. For positive numbers, floor division equals truncation. For negative numbers, floor division rounds down (more negative) while truncation rounds toward zero.

Variable Definitions

  • a: The dividend (number being divided)
  • b: The divisor (number dividing into the dividend)
  • q: The quotient from floor division (rounded toward negative infinity)
  • r: The remainder: r = a - b × q
  • ⌊x⌋: The floor function — greatest integer less than or equal to x

Floor Division of -7 by 3

Compute floor division and remainder for -7 ÷ 3 to see how floor division differs from truncation.

  1. Step 1: Identify inputs. Dividend a = -7, Divisor b = 3.
  2. Step 2: Standard division: -7 / 3 = -2.333...
  3. Step 3: Floor division rounds toward negative infinity: ⌊-2.333⌋ = -3.
  4. Step 4: Compute remainder: r = -7 - (3 × -3) = -7 + 9 = 2.
  5. Step 5: Verify: 3 × (-3) + 2 = -9 + 2 = -7. ✓
  6. Step 6: Note: Truncation would give -2, but floor division gives -3. The remainder is 2 (positive), which is the standard behavior in Python's floor division.

Frequently Asked Questions

What is the difference between floor division and regular division?

Regular division returns a floating-point result (e.g., -7 / 3 = -2.333...). Floor division returns the quotient rounded toward negative infinity (e.g., -7 // 3 = -3). For positive numbers, they give the same integer part. For negative numbers, floor division rounds down while truncation rounds toward zero.

What is the floor division operator in programming?

The floor division operator is // in Python and other languages. It divides two numbers and rounds the result toward negative infinity. For example, 7 // 2 = 3 and -7 // 2 = -4 (not -3, because floor rounds down).

How does floor division differ from truncation division?

Floor division rounds toward negative infinity (⌊x⌋), while truncation rounds toward zero (trunc(x)). For positive numbers, they are identical. For negative results: floor(-2.7) = -3, but trunc(-2.7) = -2. Python uses floor division (//), while languages like C use truncation for integer division.

What is the relationship between floor division and the modulo operator?

Floor division and modulo are complementary: a = (a // b) × b + (a % b). The remainder always has the same sign as the divisor in floor division. For example: -7 = (-3) × 3 + 2. In truncation division: -7 = (-2) × 3 + (-1).

Can floor division be used with negative divisors?

Yes. Floor division works with any integers. For example, 7 // (-3) = -3 (rounds toward -∞). The remainder is 7 - (-3 × -3) = 7 - 9 = -2. The remainder always has the same sign as the divisor (negative in this case).

How do I compute floor division of very large numbers?

Floor division works the same way for large numbers as for small ones. Most programming languages handle arbitrary-precision integers. The mathematical formula q = ⌊a/b⌋ applies regardless of size, though computational efficiency may vary.

What are practical uses of floor division?

Floor division is used in: (1) Array indexing — converting a linear index to row/column, (2) Time calculations — converting total seconds to hours, (3) Currency — converting cents to dollars, (4) Pixel calculations — computing tile coordinates from screen position, (5) Algorithm design — divide-and-conquer and pagination.

How do I calculate floor division manually?

Method 1: Divide normally, then round toward negative infinity. For -7/3: -2.33 rounds to -3. Method 2: Use the formula q = ⌊a/b⌋. For positive numbers, just truncate. For negative results, subtract 1 from the truncated quotient if there is a remainder.

What happens when I divide by zero?

Division by zero is undefined in mathematics. Floor division by zero produces an error in all programming languages and calculators. Always ensure the divisor is non-zero before performing floor division.