summaryrefslogtreecommitdiff
path: root/src/lobject.js
diff options
context:
space:
mode:
authorBenoit Giannangeli <giann008@gmail.com>2017-04-10 13:47:01 +0200
committerBenoit Giannangeli <giann008@gmail.com>2017-04-10 13:54:58 +0200
commit204ab9fba5a7a1e2e6981c11e0a6c67764332d21 (patch)
tree4976b9295969a7b0a2b4b124710d235771f325e4 /src/lobject.js
parent89e4a76a812499cc108bb77fb5c9ae1877123df6 (diff)
downloadfengari-204ab9fba5a7a1e2e6981c11e0a6c67764332d21.tar.gz
fengari-204ab9fba5a7a1e2e6981c11e0a6c67764332d21.tar.bz2
fengari-204ab9fba5a7a1e2e6981c11e0a6c67764332d21.zip
nan, -inf, inf
Diffstat (limited to 'src/lobject.js')
-rw-r--r--src/lobject.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lobject.js b/src/lobject.js
index b2cffe3..66a0dcb 100644
--- a/src/lobject.js
+++ b/src/lobject.js
@@ -556,8 +556,8 @@ const intarith = function(L, op, v1, v2) {
case lua.LUA_OPBXOR: return (v1 ^ v2);
case lua.LUA_OPSHL: return (v1 << v2);
case lua.LUA_OPSHR: return (v1 >> v2);
- case lua.LUA_OPUNM: return (-v1);
- case lua.LUA_OPBNOT: return (~v1);
+ case lua.LUA_OPUNM: return (0 - v1);
+ case lua.LUA_OPBNOT: return (~0 ^ v1);
}
};