javascript - Modulo operator -


9%4 = 1

1%4 , answer 1

2%4 , answer 2

answer found. - closed.

the meaning of mod take remainder after doing division.

1 fits 0 times in 4, remainder 1.

here wikipedia definition explains in little more detail:

in mathematics result of modulo operation remainder of arithmetic division. known, arithmetic division of 2 integers produces quotient , remainder.


Comments

Popular posts from this blog

java - BeanIO write annotated class to fixedlength -

Using Java 8 lambdas/transformations to combine and flatten two Maps -

How to connect android app to App engine -