summaryrefslogtreecommitdiff
path: root/src/lobject.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/lobject.js')
-rw-r--r--src/lobject.js6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/lobject.js b/src/lobject.js
index ec88e34..6d86852 100644
--- a/src/lobject.js
+++ b/src/lobject.js
@@ -545,11 +545,7 @@ const numarith = function(L, op, v1, v2) {
case defs.LUA_OPPOW: return Math.pow(v1, v2);
case defs.LUA_OPIDIV: return Math.floor(v1 / v2);
case defs.LUA_OPUNM: return -v1;
- case defs.LUA_OPMOD:
- let m = v1 % v2;
- if ((m*v2) < 0)
- m += v2;
- return m;
+ case defs.LUA_OPMOD: return llimit.luai_nummod(L, v1, v2);
default: assert(0);
}
};