Divide two numbers and round down to the nearest integer. Discover quotient, remainder, and the difference from standard division.
Last updated: May 2026 | By Patchworkr Team
| Dividend | Divisor | Standard | Floor (//) | Remainder (%) |
|---|---|---|---|---|
| 10 | 3 | 3.33 | 3 | 1 |
| -7 | 3 | -2.33 | -3 | 2 |
| 17 | 5 | 3.4 | 3 | 2 |
| 20 | 4 | 5.0 | 5 | 0 |
| -10 | 3 | -3.33 | -4 | 2 |
Floor division is the operation of dividing two numbers and rounding down to the nearest integer (towards negative infinity). It differs from standard division in that it always returns an integer result, and for negative numbers, it rounds away from zero rather than towards it.
In programming, floor division is represented by the `//` operator in Python and many other languages. It's essential for algorithms requiring integer results: array indexing, pixel coordinates, pagination math, and resource distribution. The companion operator modulo (`%`) gives the remainder, and together they satisfy: $a = (a \div b) \times b + (a \bmod b)$.
Key difference: what happens to decimals
Note: For negative numbers, floor always rounds down (towards negative infinity), not towards zero.
For positive numbers, yes. For negative numbers, no—truncation rounds towards zero (-2.9 → -2), while floor always rounds down to -3.
It's essential for array indexing, pagination, binning items, pixel calculations, and any algorithm needing guaranteed integer results.
The modulo operator returns the remainder. It pairs with floor division: dividend = quotient × divisor + remainder.
Because floor rounds towards negative infinity. The exact result -2.33... rounds down to -3, not up to -2.
Simply use the // operator: result = 10 // 3 yields 3. Also works with negative numbers as expected.
Floor division works on floats too: 7.5 // 2 = 3.0. Always rounds down regardless of decimal values.
Sign conventions vary by language. Python ensures remainder has same sign as divisor; JavaScript % can be negative.
Yes: dividend = (quotient × divisor) + remainder. This identity always holds for floor division.
Related Tools