Calculate quotient and remainder from division
Enter a dividend and a divisor to find the result of floor division. This operation yields the integer part of the division result.
Floor division always rounds down to the nearest integer. For positive numbers, this is the same as truncating the decimal. For negative numbers, it rounds away from zero.
page = floor(item_index / items_per_page)
.floor(a/n)
for positive n.floor(50 / 12) = 4
boxes.a = bq + r
often matches the sign of the divisor b
in many programming languages (like Python) that use floor division for their integer division.r
can be defined as: r = a - n * floor(a / n)
. This identity ensures that a = n*q + r
holds true, where q
is the result of floor division.