diff --git a/conf.lua b/conf.lua index 0496407..f0c2307 100644 --- a/conf.lua +++ b/conf.lua @@ -153,7 +153,7 @@ function generate_settingtypes(default_conf, constraints) local range = constraints.range if range then -- TODO consider better max - type_args = (constraints.int and "%d %d" or "%f %f"):format(range[1], range[2] or math.pow(2, 30)) + type_args = (constraints.int and "%d %d" or "%f %f"):format(range[1], range[2] or 2 ^ 30) end -- HACK if not default_conf then default_conf = range[1] end diff --git a/math.lua b/math.lua index 0f6716d..70f396c 100644 --- a/math.lua +++ b/math.lua @@ -39,7 +39,7 @@ function tostring(number, base, digit_function, precision) number = number % 1 if number ~= 0 and number >= base ^ -precision then table.insert(out, ".") - while precision >= 0 and number >= math.pow(base, precision) do + while precision >= 0 and number >= base ^ precision do number = number * base digit = math.floor(number % base) table.insert(out, digit_function(digit)) diff --git a/minetest.lua b/minetest.lua index b2da5d8..93d878f 100644 --- a/minetest.lua +++ b/minetest.lua @@ -1,4 +1,4 @@ -max_wear = math.pow(2, 16) - 1 +max_wear = 2 ^ 16 - 1 function override(function_name, function_builder) local func = minetest[function_name] minetest["original_" .. function_name] = func diff --git a/text.lua b/text.lua index 49dd517..ea98f61 100644 --- a/text.lua +++ b/text.lua @@ -120,9 +120,9 @@ function utf8(number) result = string.char(128 + remainder) .. result number = (number - remainder) / 64 i = i + 1 - if number <= math.pow(2, 8 - i - 2) then break end + if number <= 2 ^ (8 - i - 2) then break end end - return string.char(256 - math.pow(2, 8 - i - 1) + number) .. result + return string.char(256 - 2 ^ (8 - i - 1) + number) .. result end --+ deprecated