[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Hidden integers...
- From: "Ben Cooley" <benc@...>
- Date: Wed, 18 Apr 2001 01:15:50 -0700
Native integer support in lua...
Integer division with the / operator would aways return a number, NOT an
integer. For integer division resulting in an integer result and remainder
you would need to use the idiv(a,b) function.
i = 100 / 2
would return the number 50.0.
i,r = idiv(101,2)
would return the integers 50 and 1 respectively.
i = imod(a,b)
Would return the integer modulus of the values passed in a and b.