Module:Math: Difference between revisions
Jump to navigation
Jump to search
Content added Content deleted
m (1 revision imported) |
en>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 |
||