--- title: Math.exp() slug: Web/JavaScript/Reference/Global_Objects/Math/exp translation_of: Web/JavaScript/Reference/Global_Objects/Math/exp ---
Math.exp() 函数返回 e^x,x 表示参数,e 是欧拉常数(Euler's constant),自然对数的底数。
Math.exp(x)
x由于 exp 是 Math 的静态方法,所以应该像这样使用:Math.exp(),而不是作为你创建的 Math 实例的方法。
Math.expMath.exp(-1); // 0.36787944117144233 Math.exp(0); // 1 Math.exp(1); // 2.718281828459045
| 规范版本 | 规范状态 | 注解 |
|---|---|---|
| ECMAScript 1st Edition. Implemented in JavaScript 1.0 | Standard | Initial definition. |
| {{SpecName('ES5.1', '#sec-15.8.2.8', 'Math.exp')}} | {{Spec2('ES5.1')}} | |
| {{SpecName('ES6', '#sec-math.exp', 'Math.exp')}} | {{Spec2('ES6')}} |