diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-04-04 17:20:49 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-04-04 17:20:49 -0300 |
commit | a2e414d6793fa39f17c320106e3aae87cb576ca2 (patch) | |
tree | 8d49dad7f687fe91a21a35fe394db4a010a06d51 /lmathlib.c | |
parent | 93bcb65a9ba2296818abdbfc800bbc1b9ed3b127 (diff) | |
download | lua-a2e414d6793fa39f17c320106e3aae87cb576ca2.tar.gz lua-a2e414d6793fa39f17c320106e3aae87cb576ca2.tar.bz2 lua-a2e414d6793fa39f17c320106e3aae87cb576ca2.zip |
`pow' must be global (as the implementation of '^')
Diffstat (limited to 'lmathlib.c')
-rw-r--r-- | lmathlib.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lmathlib.c,v 1.41 2002/03/20 12:54:08 roberto Exp roberto $ | 2 | ** $Id: lmathlib.c,v 1.42 2002/04/02 20:41:59 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 | */ |
@@ -220,7 +220,6 @@ 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}, | ||
224 | {"rad", math_rad}, | 223 | {"rad", math_rad}, |
225 | {"random", math_random}, | 224 | {"random", math_random}, |
226 | {"randomseed", math_randomseed}, | 225 | {"randomseed", math_randomseed}, |
@@ -237,6 +236,7 @@ LUALIB_API int lua_mathlibopen (lua_State *L) { | |||
237 | luaL_openlib(L, mathlib, 0); | 236 | luaL_openlib(L, mathlib, 0); |
238 | lua_pushliteral(L, "pi"); | 237 | lua_pushliteral(L, "pi"); |
239 | lua_pushnumber(L, PI); | 238 | lua_pushnumber(L, PI); |
239 | lua_register(L, "pow", math_pow); | ||
240 | lua_settable(L, -3); | 240 | lua_settable(L, -3); |
241 | lua_settable(L, LUA_GLOBALSINDEX); | 241 | lua_settable(L, LUA_GLOBALSINDEX); |
242 | return 0; | 242 | return 0; |