+ 1
What is Floor division & modulo operator?
3 Respostas
+ 1
20 / 6 = 3 remainder 2
^ ^
floor division modulo
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)
0
modulo operator %
7%4 = 3 it gives the remainder
floor division /
7/2 = 3 it gives the value to the nearest small integer