summaryrefslogtreecommitdiff
path: root/lmathlib.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2001-03-06 17:09:38 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2001-03-06 17:09:38 -0300
commit6d4db86888ea8ef06b78646f2631891c9e4c7a2b (patch)
tree7a7b19dc6b3d786f4f974e702bf69eac9775b70f /lmathlib.c
parente9a38203700865d36c3b2861200674a21930c1b5 (diff)
downloadlua-6d4db86888ea8ef06b78646f2631891c9e4c7a2b.tar.gz
lua-6d4db86888ea8ef06b78646f2631891c9e4c7a2b.tar.bz2
lua-6d4db86888ea8ef06b78646f2631891c9e4c7a2b.zip
open functions are lua_Cfunctions
Diffstat (limited to 'lmathlib.c')
-rw-r--r--lmathlib.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lmathlib.c b/lmathlib.c
index 4f6fb122..739426bb 100644
--- a/lmathlib.c
+++ b/lmathlib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lmathlib.c,v 1.35 2001/02/22 18:59:59 roberto Exp roberto $ 2** $Id: lmathlib.c,v 1.36 2001/02/23 17:17:25 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*/
@@ -228,11 +228,12 @@ static const luaL_reg mathlib[] = {
228/* 228/*
229** Open math library 229** Open math library
230*/ 230*/
231LUALIB_API void lua_mathlibopen (lua_State *L) { 231LUALIB_API int lua_mathlibopen (lua_State *L) {
232 luaL_openl(L, mathlib); 232 luaL_openl(L, mathlib);
233 lua_pushcfunction(L, math_pow); 233 lua_pushcfunction(L, math_pow);
234 lua_settagmethod(L, LUA_TNUMBER, l_s("pow")); 234 lua_settagmethod(L, LUA_TNUMBER, l_s("pow"));
235 lua_pushnumber(L, PI); 235 lua_pushnumber(L, PI);
236 lua_setglobal(L, l_s("PI")); 236 lua_setglobal(L, l_s("PI"));
237 return 0;
237} 238}
238 239