0

So, im a c# guy, and cant seem to figure out what "%" means in Javascript and c++?

would be helpful..

8th Nov 2016, 8:33 PM
haavardkleven
haavardkleven - avatar
2 Respostas
+ 3
It's the modulo operator: https://en.m.wikipedia.org/wiki/Modulo_operation Basically, a%b subtracts from a the largest multiple of b without getting a negative number and then takes the remainder 5%4 = 5-4*1 = 1 9%4 = 9-4*2 = 1 12%4 = 12-4*3 = 0 ...and so on. One can observe that by using the modulo operator one will always get a value lower than b.
8th Nov 2016, 8:39 PM
Mikal S
Mikal S - avatar
0
Great answer, thank you!
8th Nov 2016, 8:42 PM
haavardkleven
haavardkleven - avatar