util/mathcompat.lua
author Kim Alvefur <zash@zash.se>
Mon, 08 Apr 2024 16:44:11 +0200
changeset 13482 fe7557cf31a6
parent 12786 8815d3090928
permissions -rw-r--r--
mod_http_file_share: Fix expiry disabled check for new config API Similar to 26c30844cac6

if not math.type then

	local function math_type(t)
		if type(t) == "number" then
			if t % 1 == 0 and t ~= t + 1 and t ~= t - 1 then
				return "integer"
			else
				return "float"
			end
		end
	end
	_G.math.type = math_type
end