summaryrefslogtreecommitdiff
path: root/src/lmathlib.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/lmathlib.js')
-rw-r--r--src/lmathlib.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lmathlib.js b/src/lmathlib.js
index 7d3a082..8c7b8a5 100644
--- a/src/lmathlib.js
+++ b/src/lmathlib.js
@@ -39,7 +39,7 @@ const math_random = function(L) {
lua.to_luastring("interval too large", true));
r *= (up - low) + 1;
- lua.lua_pushinteger(L, r + low);
+ lua.lua_pushinteger(L, Math.floor(r) + low);
return 1;
};