util/mathcompat.lua
author Matthew Wild <mwild1@gmail.com>
Wed, 06 Mar 2024 17:38:21 +0000
changeset 13460 e9ab660b9c5f
parent 12786 8815d3090928
permissions -rw-r--r--
mod_pubsub: Add shell commands to create and list nodes

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