aboutsummaryrefslogtreecommitdiff
path: root/lmathlib.c
diff options
context:
space:
mode:
Diffstat (limited to 'lmathlib.c')
-rw-r--r--lmathlib.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/lmathlib.c b/lmathlib.c
index 6afbcab6..c9397376 100644
--- a/lmathlib.c
+++ b/lmathlib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lmathlib.c,v 1.56 2003/03/11 12:30:37 roberto Exp roberto $ 2** $Id: lmathlib.c,v 1.57 2003/10/07 20:13:41 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*/
@@ -235,12 +235,10 @@ static const luaL_reg mathlib[] = {
235*/ 235*/
236LUALIB_API int luaopen_math (lua_State *L) { 236LUALIB_API int luaopen_math (lua_State *L) {
237 luaL_openlib(L, LUA_MATHLIBNAME, mathlib, 0); 237 luaL_openlib(L, LUA_MATHLIBNAME, mathlib, 0);
238 lua_pushliteral(L, "pi");
239 lua_pushnumber(L, PI); 238 lua_pushnumber(L, PI);
240 lua_settable(L, -3); 239 lua_setfield(L, -2, "pi");
241 lua_pushliteral(L, "__pow");
242 lua_pushcfunction(L, math_pow); 240 lua_pushcfunction(L, math_pow);
243 lua_settable(L, LUA_GLOBALSINDEX); 241 lua_setfield(L, LUA_GLOBALSINDEX, "__pow");
244 return 1; 242 return 1;
245} 243}
246 244