LUAL_OPTNUMBER(3) Library Functions Manual LUAL_OPTNUMBER(3)

luaL_optnumber — if the function argument is a number, returns this number

#include <lauxlib.h>

lua_Number
luaL_optnumber(lua_State *L, int narg, lua_Number d);

Function indicator: [-0, +0, v].

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

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

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

July 26, 2022 Debian