Wyseguy79 wrote on 03 mrt 2006 in comp.lang.javascript
:
I am looking at a line of code in javascript that I dont understand...
var ad = n % nn;
What I dont understand is what the % represents as a mathmatical
function in javascript.
If anyone could explain what its doing, that would be great.
read the specs:
result = number1 % number2
The modulus, or remainder, operator divides number1 by number2 and returns
only the remainder as result. The sign of result is the same as the sign of
number1. The value of result is between 0 and the absolute value of
number2.
For example, in the following expression, A (which is result) equals 5.6.
A = 19 % 6.7
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)