aboutsummaryrefslogtreecommitdiff
path: root/compat53/module.lua
diff options
context:
space:
mode:
Diffstat (limited to 'compat53/module.lua')
-rw-r--r--compat53/module.lua1
1 files changed, 1 insertions, 0 deletions
diff --git a/compat53/module.lua b/compat53/module.lua
index 225d8ca..67b2a4a 100644
--- a/compat53/module.lua
+++ b/compat53/module.lua
@@ -115,6 +115,7 @@ if lua_version < "5.3" then
115 M.math.mininteger = minint 115 M.math.mininteger = minint
116 116
117 function M.math.tointeger(n) 117 function M.math.tointeger(n)
118 n = tonumber(n)
118 if type(n) == "number" and n <= maxint and n >= minint and n % 1 == 0 then 119 if type(n) == "number" and n <= maxint and n >= minint and n % 1 == 0 then
119 return n 120 return n
120 end 121 end