1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
|
---
title: Math.exp()
slug: Web/JavaScript/Reference/Global_Objects/Math/exp
translation_of: Web/JavaScript/Reference/Global_Objects/Math/exp
original_slug: Web/JavaScript/Referencia/Objetos_globales/Math/exp
---
<div>{{JSRef}}</div>
<div>La función <strong>Math.exp()</strong> devuelve <code>e<sup>x</sup></code>, donde <code>x</code> es el argumento, y <code>e</code> es {{jsxref("Math.E", "El número de Euler (también conocido como la constante de Napier)", "", 1)}}, la base de los algoritmos naturales.</div>
<div> </div>
<h2 id="Sintaxis">Sintaxis</h2>
<pre class="syntaxbox"><code>Math.exp(<var>x</var>)</code></pre>
<h3 id="Parámetros">Parámetros</h3>
<dl>
<dt><code>x</code></dt>
<dd>Un número.</dd>
</dl>
<h3 id="Valor_devuelto">Valor devuelto</h3>
<p>Un número represetando <code>e<sup>x</sup></code>, donde <code>e</code> es {{jsxref("Math.E", "número de Euler", "", 1)}} y <code>x</code> es el argumento.</p>
<h2 id="Descripción">Descripción</h2>
<p>Porque <code>exp()</code> es un método estático de <code>Math</code>, siempre úsalo como <code>Math.exp()</code>, en vez de un método de un objeto <code>Math</code> que hayas creado (<code>Math</code> no es un constructor).</p>
<h2 id="Ejemplos">Ejemplos</h2>
<h3 id="Usando_Math.exp()">Usando <code>Math.exp()</code></h3>
<pre class="brush: js">Math.exp(-1); // 0.36787944117144233
Math.exp(0); // 1
Math.exp(1); // 2.718281828459045
</pre>
<h2 id="Especificaciones">Especificaciones</h2>
<table class="standard-table">
<tbody>
<tr>
<th scope="col">Especificación</th>
<th scope="col">Estado</th>
<th scope="col">Comentario</th>
</tr>
<tr>
<td>{{SpecName('ES1')}}</td>
<td>{{Spec2('ES1')}}</td>
<td>
<p>Definición inicial. Implementado en JavaScript 1.0.</p>
</td>
</tr>
<tr>
<td>{{SpecName('ES5.1', '#sec-15.8.2.8', 'Math.exp')}}</td>
<td>{{Spec2('ES5.1')}}</td>
<td> </td>
</tr>
<tr>
<td>{{SpecName('ES6', '#sec-math.exp', 'Math.exp')}}</td>
<td>{{Spec2('ES6')}}</td>
<td> </td>
</tr>
<tr>
<td>{{SpecName('ESDraft', '#sec-math.exp', 'Math.exp')}}</td>
<td>{{Spec2('ESDraft')}}</td>
<td> </td>
</tr>
</tbody>
</table>
<h2 id="Compatibilidad_con_navegadores">Compatibilidad con navegadores</h2>
{{Compat("javascript.builtins.Math.exp")}}
<h2 id="Ve_también">Ve también</h2>
<ul>
<li>{{jsxref("Math.E")}}</li>
<li>{{jsxref("Math.expm1()")}}</li>
<li>{{jsxref("Math.log()")}}</li>
<li>{{jsxref("Math.log10()")}}</li>
<li>{{jsxref("Math.log1p()")}}</li>
<li>{{jsxref("Math.log2()")}}</li>
<li>{{jsxref("Math.pow()")}}</li>
</ul>
|