0
What is the difference between Floor division and Normal division in Python?
2 Antworten
+ 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
+ 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.