lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 27-Sep-06, at 7:41 PM, Glenn Maynard wrote:

This is why % and // seem out of place to me; integers are not a
fundamental type in Lua, only numbers are.  (Granted, % is defined
for floating point numbers, but I have no idea what use it has and
its primary use seems intended to be integers.)
It is sometimes useful to do integer arithemetic; a useful subset of 
Lua numbers are integers. A number of interesting algorithms involve 
integer arithmetic.
But as you say, % (and //) are well-defined for non-integers, and they 
do have uses even if they haven't been useful for you. (I have $1.38 in 
my pocket, and apples cost $0.16 each. How many apples can I buy?)