Function Math.logN
Compute the logarithm of a number using any base.
-
Syntax
Number Math.logN(Number x , Number b )
This function lets you compute the logarithm of any numberxusing baseb. If the base is 2 or 10 then the JavaScript constantsMath.LOG2EandMath.LOG10Eare used for better precision. -
Parameters
Number x- The number you wish to calculate the logarithm of.
Number b- The base of the logarithm
- Return value The logarithm of x using base b
-
Examples
- To compute the logarithm of 1000 using base 10
// Output 3 Math.logN(1000,10);
-
Download
Source
Unless otherwise noted all code in the JSLab Standard Library is licensed as GPLv3. See http://www.gnu.org/licenses/gpl.html for the entire license.
