Math.log: natural logarithm
Math.log converts its argument to Number and returns an approximation of the natural logarithm with base e.
CKTIS / JavaScript
Programming syntax, operators and concepts. Find an explanation, explore an example and return to learning.
Math.log converts its argument to Number and returns an approximation of the natural logarithm with base e.
Math.log10 converts its argument to Number and returns an approximation of the base-10 logarithm.
Math.log2(x) calculates the base-2 logarithm: the exponent to which 2 must be raised to obtain x. Learn about argument conversion, special results, and precision limits.
Math.max converts every argument to Number and returns the largest resulting value.
Math.min converts every argument to Number and returns the smallest resulting value.
Math.PI is the closest Number representation of π, the ratio of a circle’s circumference to its diameter.
Math.pow(base, exponent) raises a base to a specified power and returns a Number. Learn how argument conversion works, how negative and fractional exponents behave, and when the result is NaN.
Math.random() returns a Number in [0, 1), with an approximately uniform distribution. It suits simple random choices, but provides neither cryptographic security nor a reproducible seed.
Math.round converts its argument to Number and returns the nearest integral Number, breaking ties toward +Infinity.
Math.sign converts its argument to Number and returns -1, +1, the corresponding zero, or NaN according to its sign.
Math.sin converts its argument to Number and returns an approximation of its sine, interpreting the angle in radians.
Math.sqrt converts its argument to Number and returns its non-negative square root, or NaN for a negative value.
Math.tan converts its argument to Number and returns an approximation of its tangent, interpreting the angle in radians.
Math.trunc converts its argument to Number and removes its fractional part, rounding toward zero.
Number.EPSILON is the difference between 1 and the smallest representable Number greater than 1, equal to 2^-52.
Number.isFinite returns true only for a Number argument that is neither NaN nor positive or negative infinity.
Number.isInteger returns true when its argument is a finite Number with no fractional part, without converting other types.
Number.isNaN returns true only when its argument has Number type and is the special NaN value.
Number.isSafeInteger returns true for an integral Number from -(2^53−1) through 2^53−1, where binary64 preserves integer precision.
Number.MAX_SAFE_INTEGER has the exact value 2^53−1, or 9007199254740991, and marks the positive boundary of Number’s safe integer range.
Number.MIN_SAFE_INTEGER has the exact value −(2^53−1), or -9007199254740991, and marks the negative boundary of Number’s safe integer range.
Number.NaN is the special Number value for an invalid or indeterminate numeric result and is the same value as global NaN.
Number.NEGATIVE_INFINITY is the Number value -Infinity, smaller than every finite number and identical to global -Infinity.
Number.parseFloat converts its argument to text, skips leading white space, and returns the number from the longest valid decimal prefix or NaN.