[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Odd and Even
- From: Antero Vipunen <antero@...>
- Date: Sat, 20 Aug 2005 23:08:18 +0700
Ron Hudson wrote:
I need to tell if a number is odd or even,
I have looked at "Programming in Lua" and
there does not seem to be a modulus
(remainder) operator, or and int functions
(returns the integer part of a floating
The only way I can think to do this
is to take the number, divide it by
2, turn it into a string and look
for the ".5"
Is there a better way?
There is a math.mod function. And there will be mod operator in Lua 5.1