In one of my assignments I came across a weird implementation, and I was curious if it\'s a bug or the designed behavior.
In Python 3, division by /
ret
I hope this clarifies the situation:
/ Division
Divides left hand operand by right hand operand
b / a = 2
// Floor Division
The division of operands where the result is the quotient in which the digits after the decimal point are removed. But if one of the operands is negative, the result is floored, i.e., rounded away from zero (towards negative infinity)
9//2 = 4 and 9.0//2.0 = 4.0, -11//3 = -4, -11.0//3 = -4.0
https://www.tutorialspoint.com/python/python_basic_operators.htm