javascript log value calculation

by Francis 2013-03-19 14:37:16

Javascript log value calculation

Base 10

function log10(val)
{
return Math.log(val) / Math.LN10;
}

All base of Log value

Math.log = (function()
{
var log = Math.log;
return function(n, base)
{
return log(n)/(base ? log(base) : 1);
};
})();

Math.log(5, 10);

770
like
0
dislike
0
mail
flag

You must LOGIN to add comments