diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2013-06-20 12:02:49 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2013-06-20 12:02:49 -0300 |
commit | 453450d68751f74f0fab44bd96725a5606d2d9a1 (patch) | |
tree | bd339282cf9b010986b30e254a169956d131460e /lapi.c | |
parent | 55f566bd2270503d098404874d701f2f30abd0d3 (diff) | |
download | lua-453450d68751f74f0fab44bd96725a5606d2d9a1.tar.gz lua-453450d68751f74f0fab44bd96725a5606d2d9a1.tar.bz2 lua-453450d68751f74f0fab44bd96725a5606d2d9a1.zip |
new macro 'l_floor' (allows 'floorf' even when other math operations
do not have an 'f' variant)
Diffstat (limited to 'lapi.c')
-rw-r--r-- | lapi.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lapi.c,v 2.181 2013/06/04 19:34:51 roberto Exp roberto $ | 2 | ** $Id: lapi.c,v 2.182 2013/06/14 18:32:45 roberto Exp roberto $ |
3 | ** Lua API | 3 | ** Lua API |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -390,7 +390,7 @@ LUA_API lua_Unsigned lua_tounsignedx (lua_State *L, int idx, int *pisnum) { | |||
390 | const lua_Number twop = (~(lua_Unsigned)0) + cast_num(1); | 390 | const lua_Number twop = (~(lua_Unsigned)0) + cast_num(1); |
391 | lua_Number n = fltvalue(o); | 391 | lua_Number n = fltvalue(o); |
392 | int neg = 0; | 392 | int neg = 0; |
393 | n = l_mathop(floor)(n); | 393 | n = l_floor(n); |
394 | if (n < 0) { | 394 | if (n < 0) { |
395 | neg = 1; | 395 | neg = 1; |
396 | n = -n; | 396 | n = -n; |