0
How is the modulo working?
I don‘t know how the modulo is working. Can someone explain it to me, im not that good at maths
1 Réponse
+ 5
modulo or % is cool :)
what it does is return (give you) a number that is left after division of two numbers. all whole numbers
9 % 3 = 0
because 9/3 = 3 and there is nothing left
9 % 4 = 1
because 9/4 = 2 with 1 left
10 % 4 = 2
because 4 fits fully in 10 but you are left with 2
15 % 4 = 3
4 fits in 15 3 times, but you then have 3 left (which is modulo)