LUA_TOINTEGER(3) Library Functions Manual LUA_TOINTEGER(3)

lua_tointegerconverts the Lua value to the signed integral type, function indicator [-0, +0, -]

#include <lua.h>

lua_Integer
lua_tointeger(lua_State *L, int index);

() converts the Lua value at the given acceptable index to the signed integral type lua_Integer(3).

The Lua value must be a number or a string convertible to a number; otherwise, lua_tointeger() returns 0.

If the number is not an integer, it is truncated in some non-specified way.

lua_Integer(3)

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

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

July 14, 2022 Debian