JS: Math constants. pi, e, sqrt, etc.
trig
Math.PI-
π.
console.log(Math.PI); // 3.141592653589793
exponential and logarithm
Math.E-
Constant e. The number Limit[(1+1/n)^n,{n,∞}] .
console.log(Math.E); // 2.718281828459045
Math.LN10-
(new in ECMAScript 2015)
natural log of 10.
console.log(Math.LN10); // 2.302585092994046 Math.LN2-
natural log of 2.
console.log(Math.LN2); // 0.6931471805599453 Math.LOG10E-
base-10 log of e.
console.log(Math.LOG10E); // 0.4342944819032518 Math.LOG2E-
base-2 log of e.
console.log(Math.LOG2E); // 1.4426950408889634
power and root
Math.SQRT2-
√2
console.log(Math.SQRT2); // 1.4142135623730951 console.log(Math.pow(2, 1 / 2)); // 1.4142135623730951
Math.SQRT1_2-
1/(√2)
console.log(Math.SQRT1_2); // 0.7071067811865476 console.log(1 / Math.pow(2, 1 / 2)); // 0.7071067811865475
JavaScript. math functions.
- JS: Math (namespace)
- JS: Math. max, min
- JS: Math. sign, abs
- JS: Math ceiling, floor, round, truncate
- JS: Math. random
- JS: Power and Roots
- JS: Math exponential and logarithm
- JS: Math constants. pi, e, sqrt, etc.
- JS: Math trig functions. sin, cos, tan, asin, acos, atan
- JS: Math hyperbolic functions. sinh, cosh, tanh, etc.
- JS: Math fround, clz32, imul