summaryrefslogtreecommitdiff
path: root/plugins/MirLua/src/lua/lmathlib.c
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2015-06-21 19:42:06 +0000
committerAlexander Lantsev <aunsane@gmail.com>2015-06-21 19:42:06 +0000
commite79638b70be57501bb9995b24665a109188922fc (patch)
tree9482f9a9fcd5a461a6b9cf1b9742b3bc0df505bb /plugins/MirLua/src/lua/lmathlib.c
parent8ba0d63234b84060efe27542bf317cb9cf50b3af (diff)
MirLua: lua updated to 5.3.1
git-svn-id: http://svn.miranda-ng.org/main/trunk@14308 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MirLua/src/lua/lmathlib.c')
-rw-r--r--plugins/MirLua/src/lua/lmathlib.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/plugins/MirLua/src/lua/lmathlib.c b/plugins/MirLua/src/lua/lmathlib.c
index 002c508bc4..4f2ec60aa2 100644
--- a/plugins/MirLua/src/lua/lmathlib.c
+++ b/plugins/MirLua/src/lua/lmathlib.c
@@ -1,5 +1,5 @@
/*
-** $Id: lmathlib.c,v 1.114 2014/12/27 20:32:26 roberto Exp $
+** $Id: lmathlib.c,v 1.115 2015/03/12 14:04:04 roberto Exp $
** Standard mathematical library
** See Copyright Notice in lua.h
*/
@@ -183,6 +183,9 @@ static int math_log (lua_State *L) {
res = l_mathop(log)(x);
else {
lua_Number base = luaL_checknumber(L, 2);
+#if !defined(LUA_USE_C89)
+ if (base == 2.0) res = l_mathop(log2)(x); else
+#endif
if (base == 10.0) res = l_mathop(log10)(x);
else res = l_mathop(log)(x)/l_mathop(log)(base);
}