What is Floor division & modulo operator? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What is Floor division & modulo operator?

27th Sep 2018, 7:28 PM
Bishal Gurung
Bishal Gurung - avatar
3 Answers
+ 1
20 / 6 = 3 remainder 2 ^ ^ floor division modulo
27th Sep 2018, 8:13 PM
LunarCoffee
LunarCoffee - avatar
0
Let's say together they are a normal division split into two pieces: With floor division you get the big chunk, with modulo the rest of it. 20 // 6 == 3 (18 plus rest) 20 % 6 == 2 (just the rest)
27th Sep 2018, 7:36 PM
HonFu
HonFu - avatar
0
modulo operator % 7%4 = 3 it gives the remainder floor division / 7/2 = 3 it gives the value to the nearest small integer
27th Sep 2018, 7:40 PM
estifanos
estifanos - avatar