lua-users home
lua-l archive

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


Flemming Madsen wrote:
Hi there

I think i have found a bug.

The LNUM patch changes the test below from lua_isnumber() to
lua_isinteger() in luaL_checkinteger(). However this has the
unfortunate side effect of causing Lua to claim that numbers between
-1.0 < x < 1.0 can not be integers:

Integers are defined as a subset of real numbers that are *whole* (i.e which can be written without a fractional or decimal component). Numbers between -1.0 < x < 1.0 therefore *cannot* be integers, so unless I've misunderstood, the existing behaviour was exactly what you wanted there.

http://en.wikipedia.org/wiki/Integer

Cheers,
Rich