Jump to content

Module:Math: Difference between revisions

149 bytes added ,  6 years ago
add log10 functionality from module merge
imported>Rob Kam
m (1 revision imported: used by SDIY wiki)
w>Primefac
(add log10 functionality from module merge)
Line 296: Line 296:
local rescale = math.pow(10, precision or 0);
local rescale = math.pow(10, precision or 0);
return math.floor(value * rescale + 0.5) / rescale;
return math.floor(value * rescale + 0.5) / rescale;
end
--[[
log10
returns the log (base 10) of a number
Usage:
{{#invoke:Math | log | x }}
]]
function wrap.log10(args)
return math.log10(args[1])
end
end


Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.