When I was repairing a Project via Java that I did about a year ago I came across a piece of Code using n%7
and its a mystery to me what it does. What I understand what it exactly means - Not referring to %
.
Thanks in advance,
DR
When I was repairing a Project via Java that I did about a year ago I came across a piece of Code using n%7
and its a mystery to me what it does. What I understand what it exactly means - Not referring to %
.
Thanks in advance,
DR
It is called modulus. It can be read as n modulus 7.
The MODULUS Operator %
The modulus operator finds the modulus of its first operand with respect to the second. That is, it produces the remainder of dividing the first value by the second value. For example:
22 % 6 = 4 because 22 / 6 = 3 with a remainder of 4
read more here: http://mathbits.com/MathBits/Java/DataBasics/Mathoperators.htm