Removed util.random, added util.randomFloat

Removed util.random as it is a duplicate of math.random. Added util.randomFloat, which returns a random floating point number.
This commit is contained in:
sorucoder 2018-12-09 00:58:05 -05:00
parent 3c9f03477a
commit 3f3a2deaa8
1 changed files with 2 additions and 2 deletions

View File

@ -135,9 +135,9 @@ function Util.round(num, idp)
return util.signum(num) * math.floor(math.abs(num) * mult + 0.5) / mult
end
function Util.random(max, min)
function Util.randomFloat(max, min)
min = min or 0
return math.random(0, max-min) + min
return (max-min) * math.random() + min
end
--[[ Table functions ]] --