| 1 | --[[ |
| 2 | Copyright (C) 2014 HarpyWar ([email protected]) |
| 3 | |
| 4 | This file is a part of the PvPGN Project http://pvpgn.pro |
| 5 | Licensed under the same terms as Lua itself. |
| 6 | ]]-- |
| 7 | |
| 8 | |
| 9 | -- return rounded float value |
| 10 | function math.round(num, idp) |
| 11 | local mult = 10^(idp or 0) |
| 12 | return math.floor(num * mult + 0.5) / mult |
| 13 | end |
| 14 | |
| 15 | function math.isnan(x) return x ~= x end |
| 16 | function math.isinf(x) return (x+1)==x end |