--- title: Math.expm1() slug: Web/JavaScript/Reference/Global_Objects/Math/expm1 tags: - JavaScript - Matemáticas - Math - Method - Referencia - metodo translation_of: Web/JavaScript/Reference/Global_Objects/Math/expm1 original_slug: Web/JavaScript/Referencia/Objetos_globales/Math/expm1 ---
La función Math.expm1() regresa ex - 1, donde x es el argumento, y {{jsxref("Math.E", "e", "", 1)}} la base del logaritmo natural.
Math.expm1(x)
xUn número representando ex - 1, donde e es {{jsxref("Math.E", "Número de Euler", "", 1)}} y x es el argumento.
Debido a que expm1() es un método estático de Math, uselo siempre como Math.expm1(), en lugar de como un método del objeto Math que creó (Math no es un constructor).
Math.expm1(-1); // -0.6321205588285577 Math.expm1(0); // 0 Math.expm1(1); // 1.718281828459045
Esto puede ser emulado con la ayuda de la función {{jsxref("Math.exp()")}}:
Math.expm1 = Math.expm1 || function(x) {
return Math.exp(x) - 1;
};
| Especificación |
|---|
| {{SpecName('ESDraft', '#sec-math.expm1', 'Math.expm1')}} |
{{Compat("javascript.builtins.Math.expm1")}}