diff options
Diffstat (limited to '')
| -rw-r--r-- | lmathlib.c | 5 |
1 files changed, 2 insertions, 3 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lmathlib.c,v 1.38 2001/03/26 14:31:49 roberto Exp $ | 2 | ** $Id: lmathlib.c,v 1.1 2001/11/29 22:14:34 rieru Exp rieru $ |
| 3 | ** Standard mathematical library | 3 | ** Standard mathematical library |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -220,6 +220,7 @@ static const luaL_reg mathlib[] = { | |||
| 220 | {"log10", math_log10}, | 220 | {"log10", math_log10}, |
| 221 | {"exp", math_exp}, | 221 | {"exp", math_exp}, |
| 222 | {"deg", math_deg}, | 222 | {"deg", math_deg}, |
| 223 | {"pow", math_pow}, | ||
| 223 | {"rad", math_rad}, | 224 | {"rad", math_rad}, |
| 224 | {"random", math_random}, | 225 | {"random", math_random}, |
| 225 | {"randomseed", math_randomseed} | 226 | {"randomseed", math_randomseed} |
| @@ -230,8 +231,6 @@ static const luaL_reg mathlib[] = { | |||
| 230 | */ | 231 | */ |
| 231 | LUALIB_API int lua_mathlibopen (lua_State *L) { | 232 | LUALIB_API int lua_mathlibopen (lua_State *L) { |
| 232 | luaL_openl(L, mathlib); | 233 | luaL_openl(L, mathlib); |
| 233 | lua_pushcfunction(L, math_pow); | ||
| 234 | lua_settagmethod(L, LUA_TNUMBER, "pow"); | ||
| 235 | lua_pushnumber(L, PI); | 234 | lua_pushnumber(L, PI); |
| 236 | lua_setglobal(L, "PI"); | 235 | lua_setglobal(L, "PI"); |
| 237 | return 0; | 236 | return 0; |
