lua-users home
lua-l archive

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


> Agreed, I don’t see a cheap way to do this. I know you are wary of bloat in the libraries, but I wonder if a “math.le()” function that did the alternate form would be useful? 
> 
> function math.le(a, b)
> 	local ia, ib = math.tointeger(a), math.tointeger(b)
> 	if ia and ib then return ia <= ib else return a <= b end
> end

I don't think that function is "correct" when f==2^64.

-- Roberto