diff options
Diffstat (limited to 'lmathlib.c')
-rw-r--r-- | lmathlib.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lmathlib.c,v 1.115 2015/03/12 14:04:04 roberto Exp roberto $ | 2 | ** $Id: lmathlib.c,v 1.116 2015/06/26 19:30:32 roberto Exp $ |
3 | ** Standard mathematical library | 3 | ** Standard mathematical library |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -39,7 +39,7 @@ | |||
39 | static int math_abs (lua_State *L) { | 39 | static int math_abs (lua_State *L) { |
40 | if (lua_isinteger(L, 1)) { | 40 | if (lua_isinteger(L, 1)) { |
41 | lua_Integer n = lua_tointeger(L, 1); | 41 | lua_Integer n = lua_tointeger(L, 1); |
42 | if (n < 0) n = (lua_Integer)(0u - n); | 42 | if (n < 0) n = (lua_Integer)(0u - (lua_Unsigned)n); |
43 | lua_pushinteger(L, n); | 43 | lua_pushinteger(L, n); |
44 | } | 44 | } |
45 | else | 45 | else |