--- title: Math.expm1() slug: Web/JavaScript/Reference/Global_Objects/Math/expm1 translation_of: Web/JavaScript/Reference/Global_Objects/Math/expm1 ---
The Math.expm1() function returns ex - 1, where x is the argument, and {{jsxref("Math.E", "e", "", 1)}} the base of the natural logarithms.
Math.expm1(x)
xUm número representando ex - 1, onde e é {{jsxref("Math.E", "Euler's number", "", 1)}} e x ié o argumento.
Porque expm1() é um método estático de is Math, você sempre o usurá como Math.expm1(), do que como um método de um objeto Math que você criou (Math não é um contrutor).
This can be emulated with the help of the {{jsxref("Math.exp()")}} function:
Math.expm1 = Math.expm1 || function(x) {
return Math.exp(x) - 1;
};
Math.expm1()Math.expm1(-1); // -0.6321205588285577 Math.expm1(0); // 0 Math.expm1(1); // 1.718281828459045
| Specification |
|---|
| {{SpecName('ESDraft', '#sec-math.expm1', 'Math.expm1')}} |
{{Compat("javascript.builtins.Math.expm1")}}