summaryrefslogtreecommitdiff
path: root/src/lvm.js
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2017-05-21 18:56:10 +1000
committerdaurnimator <quae@daurnimator.com>2017-05-21 19:12:50 +1000
commitbdaa2a67b491bfc1d9521778cb3d13d386f97f93 (patch)
tree8ce64bbf6a390250547d6427bc10595664bd1ced /src/lvm.js
parentd229ba6542aa009185b28530c55887d14c76b163 (diff)
downloadfengari-bdaa2a67b491bfc1d9521778cb3d13d386f97f93.tar.gz
fengari-bdaa2a67b491bfc1d9521778cb3d13d386f97f93.tar.bz2
fengari-bdaa2a67b491bfc1d9521778cb3d13d386f97f93.zip
Use same mod operator behaviour from both lvm.js and lobject.js
Diffstat (limited to 'src/lvm.js')
-rw-r--r--src/lvm.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lvm.js b/src/lvm.js
index 300b080..b00333a 100644
--- a/src/lvm.js
+++ b/src/lvm.js
@@ -259,7 +259,7 @@ const luaV_execute = function(L) {
if (op1.ttisinteger() && op2.ttisinteger()) {
L.stack[ra] = new lobject.TValue(CT.LUA_TNUMINT, (op1.value - Math.floor(op1.value / op2.value) * op2.value)|0);
} else if (numberop1 !== false && numberop2 !== false) {
- L.stack[ra] = new lobject.TValue(CT.LUA_TNUMFLT, (numberop1 - Math.floor(numberop1 / numberop2) * numberop2));
+ L.stack[ra] = new lobject.TValue(CT.LUA_TNUMFLT, llimit.luai_nummod(L, numberop1, numberop2));
} else {
ltm.luaT_trybinTM(L, op1, op2, ra, ltm.TMS.TM_MOD);
}