Add negative and positive nan constants to math

This commit is contained in:
Lars Mueller 2021-07-18 15:11:11 +02:00
parent 4f59279591
commit 26de548e32

@ -9,6 +9,9 @@ setfenv(1, _ENV)
math.randomseed(minetest and minetest.get_us_time() or os.time() + os.clock()) math.randomseed(minetest and minetest.get_us_time() or os.time() + os.clock())
for _ = 1, 100 do math.random() end for _ = 1, 100 do math.random() end
negative_nan = 0/0
positive_nan = negative_nan ^ 1
function round(number, steps) function round(number, steps)
steps = steps or 1 steps = steps or 1
return math.floor(number * steps + 0.5) / steps return math.floor(number * steps + 0.5) / steps