I need to create an arbitrary float in Lua. It must be> 1, so math.random () is not a solution.
How can i do this?
This should generate random floats between 1 (inclusive) and 100 (exclusive)
math.random() + math.random(1, 99)
You can also use something like this to get a number between lower and greater
lower
greater
function randomFloat(lower, greater) return lower + math.random() * (greater - lower); end
Just post for fun, but you can use math.random () with no arguments for this: P
print(math.floor((math.random()*100)+0.5))