diff options
Diffstat (limited to 'src/llimit.js')
-rw-r--r-- | src/llimit.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/llimit.js b/src/llimit.js index c8455b8..31862d0 100644 --- a/src/llimit.js +++ b/src/llimit.js @@ -8,6 +8,14 @@ module.exports.LUA_MAXINTEGER = LUA_MAXINTEGER; const LUA_MININTEGER = -2147483648; module.exports.LUA_MININTEGER = LUA_MININTEGER; +const luai_nummod = function(L, a, b) { + let m = a % b; + if ((m*b) < 0) + m += b; + return m; +}; +module.exports.luai_nummod = luai_nummod; + // If later integers are more than 32bit, LUA_MAXINTEGER will then be != MAX_INT const MAX_INT = 2147483647; module.exports.MAX_INT = MAX_INT; |