diff options
Diffstat (limited to 'lmathlib.c')
-rw-r--r-- | lmathlib.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -73,7 +73,7 @@ static int math_atan (lua_State *L) { | |||
73 | static int math_toint (lua_State *L) { | 73 | static int math_toint (lua_State *L) { |
74 | int valid; | 74 | int valid; |
75 | lua_Integer n = lua_tointegerx(L, 1, &valid); | 75 | lua_Integer n = lua_tointegerx(L, 1, &valid); |
76 | if (valid) | 76 | if (l_likely(valid)) |
77 | lua_pushinteger(L, n); | 77 | lua_pushinteger(L, n); |
78 | else { | 78 | else { |
79 | luaL_checkany(L, 1); | 79 | luaL_checkany(L, 1); |
@@ -175,7 +175,8 @@ static int math_log (lua_State *L) { | |||
175 | lua_Number base = luaL_checknumber(L, 2); | 175 | lua_Number base = luaL_checknumber(L, 2); |
176 | #if !defined(LUA_USE_C89) | 176 | #if !defined(LUA_USE_C89) |
177 | if (base == l_mathop(2.0)) | 177 | if (base == l_mathop(2.0)) |
178 | res = l_mathop(log2)(x); else | 178 | res = l_mathop(log2)(x); |
179 | else | ||
179 | #endif | 180 | #endif |
180 | if (base == l_mathop(10.0)) | 181 | if (base == l_mathop(10.0)) |
181 | res = l_mathop(log10)(x); | 182 | res = l_mathop(log10)(x); |