+ 2
hello im from germany and so my englisch isnt very good. can somebody explain what the modulus does?
(var example = 26 % 6; //Output = 2)
4 Answers
+ 3
For your example, 26 divided by 6 is 4 with a remainder of 2. The modulus returns the number that is the remainder of a calculation. So, 26 modulus 6 will return an answer of 2.
+ 1
Er gibt dir den resteiner division: 26/6 geht nicht. Die nÀchst kleinere zahl wÀre 24, 24/6 geht und dann hadt du 2 rest
+ 1
Divide 5 by 2 and you get 2 as quotient (2*2) and 1 (+1=5) as remainder. The remainder part is what the modulus gives.
0
it's the remainder after integer division. examples...
7/3=1 or 26/6=2 or 6/2=0