javascript log value calculation
by Francis[ Edit ] 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);