MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / l_strton

Function l_strton

extlibs/lua/src/lvm.c:90–96  ·  view source on GitHub ↗

** Try to convert a value from string to a number value. ** If the value is not a string or is a string not representing ** a valid numeral (or if coercions from strings to numbers ** are disabled via macro 'cvt2num'), do not modify 'result' ** and return 0. */

Source from the content-addressed store, hash-verified

88** and return 0.
89*/
90static int l_strton (const TValue *obj, TValue *result) {
91 lua_assert(obj != result);
92 if (!cvt2num(obj)) /* is object not a string? */
93 return 0;
94 else
95 return (luaO_str2num(svalue(obj), result) == vslen(obj) + 1);
96}
97
98
99/*

Callers 2

luaV_tonumber_Function · 0.85
luaV_tointegerFunction · 0.85

Calls 1

luaO_str2numFunction · 0.85

Tested by

no test coverage detected