diff options
Diffstat (limited to '')
| -rw-r--r-- | mathlib.c | 5 |
1 files changed, 3 insertions, 2 deletions
| @@ -3,7 +3,7 @@ | |||
| 3 | ** Mathematics library to LUA | 3 | ** Mathematics library to LUA |
| 4 | */ | 4 | */ |
| 5 | 5 | ||
| 6 | char *rcs_mathlib="$Id: mathlib.c,v 1.23 1997/04/06 14:08:08 roberto Exp roberto $"; | 6 | char *rcs_mathlib="$Id: mathlib.c,v 1.24 1997/06/09 17:30:10 roberto Exp roberto $"; |
| 7 | 7 | ||
| 8 | #include <stdlib.h> | 8 | #include <stdlib.h> |
| 9 | #include <math.h> | 9 | #include <math.h> |
| @@ -210,7 +210,8 @@ static struct luaL_reg mathlib[] = { | |||
| 210 | void mathlib_open (void) | 210 | void mathlib_open (void) |
| 211 | { | 211 | { |
| 212 | luaL_openlib(mathlib, (sizeof(mathlib)/sizeof(mathlib[0]))); | 212 | luaL_openlib(mathlib, (sizeof(mathlib)/sizeof(mathlib[0]))); |
| 213 | lua_pushcfunction(math_pow); | ||
| 213 | lua_pushnumber(0); /* to get its tag */ | 214 | lua_pushnumber(0); /* to get its tag */ |
| 214 | lua_settagmethod(lua_tag(lua_pop()), "pow", math_pow); | 215 | lua_settagmethod(lua_tag(lua_pop()), "pow"); |
| 215 | } | 216 | } |
| 216 | 217 | ||
