LUAL_OPTINTEGER(3) Library Functions Manual LUAL_OPTINTEGER(3)

luaL_optintegercasts a number to a lua_Integer, function indicator [-0, +0, v]

#include <lauxlib.h>

lua_Integer
luaL_optinteger(lua_State *L, int narg, lua_Integer d);

() if the function argument narg is a number, returns this number cast to a lua_Integer(3). If this argument is absent or is nil, returns d. Otherwise, raises an error.

lua_Integer(3)

Roberto Ierusalimschy, Luiz Henrique de Figueiredo, and Waldemar Celes, Lua 5.1 Reference Manual.

The luaL_optinteger() manual page is based on Lua Reference Manual 5.1 and was created by Sergey Bronnikov.

July 26, 2022 Debian