0

What is the difference between Floor division and Normal division in Python?

30th Mar 2017, 4:28 PM
Arjun Yadav
Arjun Yadav - avatar
2 ответов
+ 5
Floor gets the division down to the nearest lower number (works a bit unintuitive for negative numbers): 7 // 4 = 1 7 // -4 = -2 -7 // 4 = -2 -7 // -4 = 1
30th Mar 2017, 6:08 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 3
lets suppose you have a number 7 and a number 2. so the normal division for this would be 7/2 which gives us 3.5 . whereas floor division gives the natural number that appears just before the solution of normal division on number line, which in this case would be 3. hope it helps.
30th Mar 2017, 4:59 PM
shubham khandelwal
shubham khandelwal - avatar