MCPcopy Create free account
hub / github.com/bloomberg/comdb2 / luaO_str2d

Function luaO_str2d

lua/lobject.c:102–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

100
101
102int luaO_str2d (const char *s, lua_Number *result) {
103 char *endptr;
104 *result = lua_str2number(s, &endptr);
105 if (endptr == s) return 0; /* conversion failed */
106 if (*endptr == 'x' || *endptr == 'X') /* maybe an hexadecimal constant? */
107 *result = cast_num(strtoul(s, &endptr, 16));
108 if (*endptr == '\0') return 1; /* most common case */
109 while (isspace(cast(unsigned char, *endptr))) endptr++;
110 if (*endptr != '\0') return 0; /* invalid trailing characters? */
111 return 1;
112}
113
114
115static void pushstr (lua_State *L, const char *str) {

Callers 3

luaV_tonumberFunction · 0.85
trydecpointFunction · 0.85
read_numeralFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected