MCPcopy Create free account
hub / github.com/ArduPilot/ardupilot / luaopen_math

Function luaopen_math

libraries/AP_Scripting/lua/src/lmathlib.c:402–413  ·  view source on GitHub ↗

** Open math library */

Source from the content-addressed store, hash-verified

400** Open math library
401*/
402LUAMOD_API int luaopen_math (lua_State *L) {
403 luaL_newlib(L, mathlib);
404 lua_pushnumber(L, PI);
405 lua_setfield(L, -2, "pi");
406 lua_pushnumber(L, (lua_Number)HUGE_VAL);
407 lua_setfield(L, -2, "huge");
408 lua_pushinteger(L, LUA_MAXINTEGER);
409 lua_setfield(L, -2, "maxinteger");
410 lua_pushinteger(L, LUA_MININTEGER);
411 lua_setfield(L, -2, "mininteger");
412 return 1;
413}
414

Callers 1

create_sandboxMethod · 0.85

Calls 3

lua_pushnumberFunction · 0.85
lua_setfieldFunction · 0.85
lua_pushintegerFunction · 0.85

Tested by

no test coverage detected