Free · Integers and division

Exact Floor Quotient and Remainder

Round a division toward negative infinity and obtain its signed remainder using bounded exact decimal arithmetic, including negative divisors.

  • Formula & worked example
  • Private in your browser
  • No signup
Go to tool

Calculator inputs

Loading calculator…

How to use this calculator

  1. Enter the known values in the units shown. Results update as you type.
  2. Where results are editable, change one to solve backwards. Lock a value to hold it fixed.
  3. Use the worked example to check the method. Reset restores the starting fields.

Private by default

Inputs and results stay in this browser tab. Bookify does not upload or store the values you enter.

Formula and method

For−7divided by3, the floor quotient is−3 and the remainder is2: −7=3×(−3)+2.

q=⌊a/b⌋; r=a−bq; r=0or sign(r)=sign(b), with |r|<|b|.

Worked example

Enter these known values and leave the other values blank.

Divide
-7
by
3
Floor division
-3
Remainder
2

Assumptions and limitations

  • This is floor division toward negative infinity. It differs from truncation toward zero for a negative noninteger ratio. A nonzero remainder has the divisor’s sign.
  • The exact arithmetic scope supports at most128significant decimal digits, nonzero operand magnitudes from10^-1000to below10^50, a nonzero divisor, and quotient magnitude below10^50. The dividend may be zero.
  • The quotient and exposed remainder are exact within the computational scope. The remainder note and API use the full finite decimal value, so rounding cannot make a nonzero remainder appear equal to its divisor. The hidden stored presentation field retains source formatting, but that rounded text is not used as the result.
  • The captured interface is forward-only: enter dividend and divisor. The quotient and remainder do not introduce invented inverse controls.

Common questions

Why is−7÷3 floored to−3?

The floor is the greatest integer no larger than the quotient. Since−7/3 is about−2.333, that integer is−3.

Can a remainder be negative?

Under this floor-division convention, a nonzero remainder has the same sign as the divisor. For7÷(−3), q=−3 and r=−2.

References

Compute the floor quotient and signed remainder from exact aligned decimal integers instead of flooring a rounded ratio or subtracting rounded products. Preserve the captured forward-only quotient and remainder note. Require a nonzero divisor and explicit bounded decimal representation: at most128significant digits, nonzero magnitudes from10^-1000to below10^50, and quotient magnitude below10^50. Preserve zero dividend and both divisor signs. Display retains finite small values beyond fixed-decimal resolution.

Explore integers and division or browse all math calculators.