util/mathcompat.lua
author Kim Alvefur <zash@zash.se>
Tue, 23 Apr 2024 20:01:41 +0200
changeset 13486 4d697961546d
parent 12786 8815d3090928
permissions -rw-r--r--
mod_blocklist: Fix fix signal for letting stanzas pass Returning nothing/nil lets stanzas pass, returning anything else blocks

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