0

what is the difference between floor division and normal division

27th Oct 2016, 6:01 PM
Harsh Shukla
Harsh Shukla - avatar
6 Answers
+ 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
27th Oct 2016, 9:15 PM
Alex Schrichte
Alex Schrichte - avatar
+ 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
27th Oct 2016, 6:38 PM
Waqas Asghar Bhalli
Waqas Asghar Bhalli - avatar
+ 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
28th Oct 2016, 7:40 PM
Ugra Narasimha
Ugra Narasimha - avatar
+ 1
Thanks guys for clearing doubt
5th Nov 2017, 11:00 AM
Snehal Totade
Snehal Totade - avatar
0
so floor division basically extracts the integer part from the quotient?
14th Apr 2018, 3:11 PM
Prachi Pandit
- 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
21st Aug 2018, 2:57 PM
Saif Khan
Saif Khan - avatar