diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2011-07-05 09:49:35 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2011-07-05 09:49:35 -0300 |
| commit | 79cbc3468caeab89b1c8492d54e1c28e7aafd1ed (patch) | |
| tree | ca69022ba190df2f3dbfed1d2861d2cf52f4e0af /lmathlib.c | |
| parent | 9e89a55a4fd701a9991d55b73edb93639a48d624 (diff) | |
| download | lua-79cbc3468caeab89b1c8492d54e1c28e7aafd1ed.tar.gz lua-79cbc3468caeab89b1c8492d54e1c28e7aafd1ed.tar.bz2 lua-79cbc3468caeab89b1c8492d54e1c28e7aafd1ed.zip | |
removed and deprecated functions really removed from the code base
Diffstat (limited to 'lmathlib.c')
| -rw-r--r-- | lmathlib.c | 11 |
1 files changed, 5 insertions, 6 deletions
| @@ -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) | ||
| 137 | static int math_log10 (lua_State *L) { | 138 | static 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 | ||
| 147 | static int math_exp (lua_State *L) { | 144 | static 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}, |
