diff options
Diffstat (limited to 'lmathlib.c')
| -rw-r--r-- | lmathlib.c | 15 |
1 files changed, 1 insertions, 14 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lmathlib.c,v 1.87 2013/06/13 19:32:52 roberto Exp roberto $ | 2 | ** $Id: lmathlib.c,v 1.88 2013/06/25 14:02:18 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 | */ |
| @@ -246,18 +246,6 @@ static int math_isfloat (lua_State *L) { | |||
| 246 | } | 246 | } |
| 247 | 247 | ||
| 248 | 248 | ||
| 249 | static int math_numbits (lua_State *L) { | ||
| 250 | const char *s = luaL_checkstring(L, 1); | ||
| 251 | if (*s == 'i') | ||
| 252 | lua_pushinteger(L, sizeof(lua_Integer) * CHAR_BIT); | ||
| 253 | else if (*s == 'f') | ||
| 254 | lua_pushinteger(L, sizeof(lua_Number) * CHAR_BIT); | ||
| 255 | else | ||
| 256 | luaL_argerror(L, 1, lua_pushfstring(L, "invalid option '%s'", s)); | ||
| 257 | return 1; | ||
| 258 | } | ||
| 259 | |||
| 260 | |||
| 261 | static const luaL_Reg mathlib[] = { | 249 | static const luaL_Reg mathlib[] = { |
| 262 | {"abs", math_abs}, | 250 | {"abs", math_abs}, |
| 263 | {"acos", math_acos}, | 251 | {"acos", math_acos}, |
| @@ -287,7 +275,6 @@ static const luaL_Reg mathlib[] = { | |||
| 287 | {"randomseed", math_randomseed}, | 275 | {"randomseed", math_randomseed}, |
| 288 | {"sinh", math_sinh}, | 276 | {"sinh", math_sinh}, |
| 289 | {"sin", math_sin}, | 277 | {"sin", math_sin}, |
| 290 | {"numbits", math_numbits}, | ||
| 291 | {"sqrt", math_sqrt}, | 278 | {"sqrt", math_sqrt}, |
| 292 | {"tanh", math_tanh}, | 279 | {"tanh", math_tanh}, |
| 293 | {"tan", math_tan}, | 280 | {"tan", math_tan}, |
