mirror of https://github.com/kepler155c/opus
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:
parent
3c9f03477a
commit
3f3a2deaa8
|
@ -135,9 +135,9 @@ function Util.round(num, idp)
|
||||||
return util.signum(num) * math.floor(math.abs(num) * mult + 0.5) / mult
|
return util.signum(num) * math.floor(math.abs(num) * mult + 0.5) / mult
|
||||||
end
|
end
|
||||||
|
|
||||||
function Util.random(max, min)
|
function Util.randomFloat(max, min)
|
||||||
min = min or 0
|
min = min or 0
|
||||||
return math.random(0, max-min) + min
|
return (max-min) * math.random() + min
|
||||||
end
|
end
|
||||||
|
|
||||||
--[[ Table functions ]] --
|
--[[ Table functions ]] --
|
||||||
|
|
Loading…
Reference in New Issue