+ 1

How floor division different from division

28th Jan 2018, 1:05 AM
sumit pathak
sumit pathak - avatar
3 Answers
+ 1
Floor function is greatest integer less than or equal to a number... Modulo function yields remainder.... Hope it helps...Cheers...
28th Jan 2018, 4:06 PM
Anubhav Mahapatra
Anubhav Mahapatra - avatar
import math x=13 y=4 print(x/y) print(math.floor(x/y)) Running this will show you the difference. basically, division divides the numbers resulting in 3.25.. floor division also gets 3.25 but returns the "floor".. simply 3.. floor isn't round however.. floor(3.99) doesn't round to 4.. it goes down to the floor. floor(3.99) is 3 also
28th Jan 2018, 1:42 AM
LordHill - avatar