lua_numbertointeger

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.

doc_lua
2017-02-21 04:13:47
Comments
Leave a Comment

Please login to continue.