0
What is floor divion
2 Antworten
+ 7
It's a kind of division the returns only integers, the remainder is ignored.
In Python:
12 / 5 = 2.4 (float division)
12 // 5 = 2 (floor division)
12 / -5 = -2.4 (negative float division)
12 // -5 = -3 (negative floor division)
+ 1
The floor operation is not limited to python. Floor takes a floating point number and truncates the decimal part. So floor(3.14) returns 3. Also, floor(3.99999) returns 3.