diff options
-rw-r--r-- | lmathlib.c | 6 | ||||
-rw-r--r-- | luaconf.h | 17 |
2 files changed, 21 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lmathlib.c,v 1.70 2007/06/21 13:48:04 roberto Exp roberto $ | 2 | ** $Id: lmathlib.c,v 1.71 2009/02/18 13:06:05 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 | */ |
@@ -126,6 +126,10 @@ static int math_log (lua_State *L) { | |||
126 | } | 126 | } |
127 | 127 | ||
128 | static int math_log10 (lua_State *L) { | 128 | static int math_log10 (lua_State *L) { |
129 | #if !defined(LUA_COMPAT_LOG10) | ||
130 | luaL_error(L, "function " LUA_QL("log10") | ||
131 | " is deprecated; use log(x, 10) instead"); | ||
132 | #endif | ||
129 | lua_pushnumber(L, log10(luaL_checknumber(L, 1))); | 133 | lua_pushnumber(L, log10(luaL_checknumber(L, 1))); |
130 | return 1; | 134 | return 1; |
131 | } | 135 | } |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: luaconf.h,v 1.100 2008/07/18 19:58:10 roberto Exp roberto $ | 2 | ** $Id: luaconf.h,v 1.101 2009/02/07 12:23:15 roberto Exp roberto $ |
3 | ** Configuration file for Lua | 3 | ** Configuration file for Lua |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -331,6 +331,19 @@ | |||
331 | 331 | ||
332 | 332 | ||
333 | /* | 333 | /* |
334 | ** {================================================================== | ||
335 | ** Compatibility with previous versions | ||
336 | ** =================================================================== | ||
337 | */ | ||
338 | |||
339 | /* | ||
340 | @@ LUA_COMPAT_LOG10 defines the function 'log10' in the math library. | ||
341 | ** CHANGE it (undefine it) if as soon as you rewrite all calls 'log10(x)' | ||
342 | ** as 'log(x, 10)' | ||
343 | */ | ||
344 | #define LUA_COMPAT_LOG10 | ||
345 | |||
346 | /* | ||
334 | @@ LUA_COMPAT_API includes some macros and functions that supply some | 347 | @@ LUA_COMPAT_API includes some macros and functions that supply some |
335 | @* compatibility with previous versions. | 348 | @* compatibility with previous versions. |
336 | ** CHANGE it (undefine it) if you do not need these compatibility facilities. | 349 | ** CHANGE it (undefine it) if you do not need these compatibility facilities. |
@@ -360,6 +373,8 @@ | |||
360 | */ | 373 | */ |
361 | #define LUA_COMPAT_DEBUGLIB | 374 | #define LUA_COMPAT_DEBUGLIB |
362 | 375 | ||
376 | /* }================================================================== */ | ||
377 | |||
363 | 378 | ||
364 | 379 | ||
365 | 380 | ||