0
what is the difference between floor division and normal division
6 Réponses
+ 15
The difference is this:
Regular division , /, will perform it's division task down to the T.
Floor division, //, will tell you how many times one number fits into another, without any decimal points or remainders.
Example:
24/13 = 1.867........
24//13 = 1
+ 10
There is very basix difference Normal division gives floating point number and floor division gives whole number. see below example
24/12 = 2.0 not 2 # Floating Point Number
24 // 12 = 2 not 2.0 # Whole Number
/ - is normal division it will give floating value
// - is floor division it will give integer value
+ 2
In Python by default take float data type
So any division calculations it will give us floating value
Suppose that 24/12 = 2.0 not 2
But 24 // 12 = 2 not 2.0
Try to understand difference
/ - is division it will give floating value
// - is floor division it will give integer value
+ 1
Thanks guys for clearing doubt
0
so floor division basically extracts the integer part from the quotient?
- 1
why is (98//9.8) gives 9 but
98/98 gives 10.0
whereas 51//5.1 and
51/5.1 gives 10.0