From b892f0a8774f573d7ec9b02617428871b8d3a2b3 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 26 Oct 2000 10:47:05 -0200 Subject: new API function `createuserdata' --- lmathlib.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lmathlib.c') diff --git a/lmathlib.c b/lmathlib.c index 67ef899a..6551564a 100644 --- a/lmathlib.c +++ b/lmathlib.c @@ -1,5 +1,5 @@ /* -** $Id: lmathlib.c,v 1.28 2000/08/31 20:23:40 roberto Exp roberto $ +** $Id: lmathlib.c,v 1.29 2000/10/20 16:39:03 roberto Exp roberto $ ** Standard mathematical library ** See Copyright Notice in lua.h */ @@ -230,10 +230,10 @@ static const struct luaL_reg mathlib[] = { */ LUA_API void lua_mathlibopen (lua_State *L) { luaL_openl(L, mathlib); - lua_pushnumber(L, 0); /* to get its tag */ lua_pushcfunction(L, math_pow); - lua_settagmethod(L, lua_tag(L, -2), "pow"); - lua_pop(L, 1); /* remove number */ - lua_pushnumber(L, PI); lua_setglobal(L, "PI"); + lua_settagmethod(L, LUA_TNUMBER, "pow"); + lua_pop(L, 1); /* remove result from previous call */ + lua_pushnumber(L, PI); + lua_setglobal(L, "PI"); } -- cgit v1.2.3-55-g6feb