0

What is floor divion

18th Mar 2017, 12:11 PM
waleed
2 ответов
+ 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)
18th Mar 2017, 12:31 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 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.
18th Mar 2017, 12:28 PM
Null