util/mathcompat.lua
author Matthew Wild <mwild1@gmail.com>
Fri, 23 Feb 2024 21:14:14 +0000
changeset 13441 1ba323d6f35c
parent 12786 8815d3090928
permissions -rw-r--r--
mod_server_contact_info: Update to publish fields via new mod_server_info

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