util/mathcompat.lua
author Kim Alvefur <zash@zash.se>
Sat, 24 Feb 2024 14:35:17 +0100
changeset 13447 98a6ec4ce140
parent 12786 8815d3090928
permissions -rw-r--r--
mod_cron: Fix log format to account for float that was integer before

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