og-pvpgn-server/lua/include/math.lua

16 lines
389 B
Lua
Raw Permalink Normal View History

--[[
Copyright (C) 2014 HarpyWar (harpywar@gmail.com)
This file is a part of the PvPGN Project http://pvpgn.pro
Licensed under the same terms as Lua itself.
]]--
-- return rounded float value
function math.round(num, idp)
local mult = 10^(idp or 0)
return math.floor(num * mult + 0.5) / mult
end
function math.isnan(x) return x ~= x end
function math.isinf(x) return (x+1)==x end