MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / luaO_str2d

Function luaO_str2d

Source/Misc/lua/src/lua.c:7350–7360  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7348
7349
7350int luaO_str2d (const char *s, lua_Number *result) {
7351char *endptr;
7352*result = lua_str2number(s, &endptr);
7353if (endptr == s) return 0; /* conversion failed */
7354if (*endptr == 'x' || *endptr == 'X') /* maybe an hexadecimal constant? */
7355*result = cast_num(strtoul(s, &endptr, 16));
7356if (*endptr == '\0') return 1; /* most common case */
7357while (isspace(cast(unsigned char, *endptr))) endptr++;
7358if (*endptr != '\0') return 0; /* invalid trailing characters? */
7359return 1;
7360}
7361
7362
7363

Callers 3

trydecpointFunction · 0.85
read_numeralFunction · 0.85
luaV_tonumberFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected