+ 2
What is floor division??
4 Antworten
+ 2
consider an example:
here we have,
21//4=5
what the floor operator has done is that it simply divided number 21 with 4 and displayed the quotient 5 without carrying out further division of the left out remainder 1 (i.e. when you will carry out division of 21 by 5 you will at last reach to remainder 1 without introducing decimal into the quotient)
+ 2
Floor division is looking at how many times one number will go into another as a whole, without any decimals. So if there was the expression 20//3, the answer would be 6. This is because 3 goes into 20 six (6) even times (3+3+3+3+3+3 = 18). There is a two left over, but since it is a part of three, not whole, it is not part of the answer.
0
/ result = float
// result = integer(floor)
here example of float, floor and remainder
8/4 = 2.0
9/4 = 2
9%4 = 1
0
44/4=11