Re: OT:Perl %= operator
At 996802112s since epoch (08/02/01 20:28:32 -0400 UTC), Ken Januski wrote:
> ($start +=1) %=7;
> If $start = 1 then I think that this line means 2%7. I believe that the
> intended result is 2 but I'm just not sure what 2 % 7 equals.
You're right; the answer is 2.
'mod' means the remainder of the division of the left operator by the
right.
7 divides into 2 zero times, leaving a remainder of 2. 2 is the answer.
Jason
--
Jason Healy | jhealy@logn.net
LogN Systems | http://www.logn.net/
Reply to: