Floor division

Floor division returns the quotient(answer or result of division) in which the digits after the decimal point are removed.

But if one of the operands(dividend and divisor) is negative, then the result is floored, i.e., rounded away from zero(means, towards the negative of infinity).

You can try it yourself!!

Divide 9 by 5 you will get quotient as 1.8 but if you do floor division of 9 by 5 you’ll get 1 as result just because floor division removes the digits after the decimal point.

But if either of 9 or 5 is negative then in simple division you’ll get -1.8 but in floor division the answer will be floored and rounded away from zero and the final result will be -2.

Posted on by