MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / luaV_tointegerns

Function luaV_tointegerns

lib/lua/src/lvm.c:149–158  ·  view source on GitHub ↗

** try to convert a value to an integer, rounding according to 'mode', ** without string coercion. ** ("Fast track" handled by macro 'tointegerns'.) */

Source from the content-addressed store, hash-verified

147** ("Fast track" handled by macro 'tointegerns'.)
148*/
149int luaV_tointegerns (const TValue *obj, lua_Integer *p, F2Imod mode) {
150 if (ttisfloat(obj))
151 return luaV_flttointeger(fltvalue(obj), p, mode);
152 else if (ttisinteger(obj)) {
153 *p = ivalue(obj);
154 return 1;
155 }
156 else
157 return 0;
158}
159
160
161/*

Callers 4

luaV_tointegerFunction · 0.85
luaV_equalobjFunction · 0.85
luaG_tointerrorFunction · 0.85
validopFunction · 0.85

Calls 1

luaV_flttointegerFunction · 0.85

Tested by

no test coverage detected