aboutsummaryrefslogtreecommitdiff
path: root/lmathlib.c
diff options
context:
space:
mode:
Diffstat (limited to 'lmathlib.c')
-rw-r--r--lmathlib.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/lmathlib.c b/lmathlib.c
index 39069ed0..035dd090 100644
--- a/lmathlib.c
+++ b/lmathlib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lmathlib.c,v 1.78 2010/11/12 15:47:34 roberto Exp roberto $ 2** $Id: lmathlib.c,v 1.79 2010/11/18 18:38:27 roberto Exp roberto $
3** Standard mathematical library 3** Standard mathematical library
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -134,15 +134,12 @@ static int math_log (lua_State *L) {
134 return 1; 134 return 1;
135} 135}
136 136
137#if defined(LUA_COMPAT_LOG10)
137static int math_log10 (lua_State *L) { 138static int math_log10 (lua_State *L) {
138#if !defined(LUA_COMPAT_LOG10)
139 return luaL_error(L, "function " LUA_QL("log10")
140 " is deprecated; use log(x, 10) instead");
141#else
142 lua_pushnumber(L, l_tg(log10)(luaL_checknumber(L, 1))); 139 lua_pushnumber(L, l_tg(log10)(luaL_checknumber(L, 1)));
143 return 1; 140 return 1;
144#endif
145} 141}
142#endif
146 143
147static int math_exp (lua_State *L) { 144static int math_exp (lua_State *L) {
148 lua_pushnumber(L, l_tg(exp)(luaL_checknumber(L, 1))); 145 lua_pushnumber(L, l_tg(exp)(luaL_checknumber(L, 1)));
@@ -252,7 +249,9 @@ static const luaL_Reg mathlib[] = {
252 {"fmod", math_fmod}, 249 {"fmod", math_fmod},
253 {"frexp", math_frexp}, 250 {"frexp", math_frexp},
254 {"ldexp", math_ldexp}, 251 {"ldexp", math_ldexp},
252#if defined(LUA_COMPAT_LOG10)
255 {"log10", math_log10}, 253 {"log10", math_log10},
254#endif
256 {"log", math_log}, 255 {"log", math_log},
257 {"max", math_max}, 256 {"max", math_max},
258 {"min", math_min}, 257 {"min", math_min},