How to calculate a log base 10 equation
Math.log( ) just givesme the natural log. I've tried Math.log(10, ( ) ), Math.log10( ), console.log(getBaseLog(10, ( ) ), console.log(Math.log10( )). Now I'm at a loss on how to go about solving this.
Math.log( ) just givesme the natural log. I've tried Math.log(10, ( ) ), Math.log10( ), console.log(getBaseLog(10, ( ) ), console.log(Math.log10( )). Now I'm at a loss on how to go about solving this.
However, you can easily write a function that returns the log10 value using the log method, like this:
function log10(val) {
return Math.log(val) / Math.LN10;
}
And then you can call it like this, for example:
log10(2)
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.