From: Matthew Smillie Date: 2005-12-31T10:51:53+09:00 Subject: Re: Another Newb asks questions. On Dec 31, 2005, at 1:02, Joseph Divelbiss wrote: > Wilson Bilkovich wrote: >> if file.lineno % 2 == 1 then > > I hope youll forgive, but I seem to be at a loss for exactly what/how > this is doing..? > > Any clarification? > > Yeah this is my first language, first project, first week; so label me > silly. % is the modulo operator. It gives the remainder of integer division: x / y = a (rem b) y * a + b = x Concrete example: 17 / 3 = 5 (rem 2) 5 * 3 + 2 = 17 Modulo returns 0 if the numerator is evenly divisible by the denominator, so modulo 2 is a good way to check if a number is even. m.s.