From 9903dd52a39fbe4531596b1266e226f01769de21 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Tue, 20 Dec 2016 16:37:00 -0200 Subject: Using LUAI_UAC* types more consistently on vararg calls --- lmathlib.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'lmathlib.c') diff --git a/lmathlib.c b/lmathlib.c index 8c9627c2..4cf90ce4 100644 --- a/lmathlib.c +++ b/lmathlib.c @@ -1,5 +1,5 @@ /* -** $Id: lmathlib.c,v 1.116 2015/06/26 19:30:32 roberto Exp $ +** $Id: lmathlib.c,v 1.117 2015/10/02 15:39:23 roberto Exp roberto $ ** Standard mathematical library ** See Copyright Notice in lua.h */ @@ -184,10 +184,13 @@ static int math_log (lua_State *L) { else { lua_Number base = luaL_checknumber(L, 2); #if !defined(LUA_USE_C89) - if (base == 2.0) res = l_mathop(log2)(x); else + if (base == l_mathop(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); + if (base == l_mathop(10.0)) + res = l_mathop(log10)(x); + else + res = l_mathop(log)(x)/l_mathop(log)(base); } lua_pushnumber(L, res); return 1; -- cgit v1.2.3-55-g6feb