lua_numbertointeger
int lua_numbertointeger (lua_Number n, lua_Integer *p);
Converts a Lua float to a Lua integer. This macro assumes that n
has an integral value. If that value is within the range of Lua integers, it is converted to an integer and assigned to *p
. The macro results in a boolean indicating whether the conversion was successful. (Note that this range test can be tricky to do correctly without this macro, due to roundings.)
This macro may evaluate its arguments more than once.
Please login to continue.