aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lmathlib.js4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/lmathlib.js b/src/lmathlib.js
index 8000b4d..4a62d52 100644
--- a/src/lmathlib.js
+++ b/src/lmathlib.js
@@ -132,9 +132,7 @@ const math_sqrt = function(L) {
const math_ult = function(L) {
let a = lauxlib.luaL_checkinteger(L, 1);
let b = lauxlib.luaL_checkinteger(L, 2);
- if (a < 0) a += 4294967296;
- if (b < 0) b += 4294967296;
- lua.lua_pushboolean(L, a < b);
+ lua.lua_pushboolean(L, (a >= 0)?(b<0 || a<b):(b<0 && a<b));
return 1;
};