JavaScript Math method: exp()
[this page | pdf | back links]
The exp() method (of the Math object)
returns the exponential of a real number (i.e.
).
It
has the following syntax with the following parameters:
Math.exp(x)
Parameter
|
Required / Optional
|
Description
|
x
|
Required
|
Input parameter
|
EXAMPLE:
HTML USED IN THIS EXAMPLE:
<!DOCTYPE html>
<html> <!-- Copyright (c) Nematrian Limited 2018 -->
<head>
<style>
table,th,tr,td {border: 1px solid black; border-collapse: collapse;}
</style>
</head>
<body>
<table>
<tr>
<th>Example</th>
<th>Resulting value of <code>x</code></th>
</tr>
<tr>
<td><code id="Example"></code></td>
<td><code id="Result"></code></td>
</tr>
</table>
<script>
var b = -0.2;
document.getElementById("Example").innerHTML =
'var x = Math.exp(' + b + ')';
document.getElementById("Result").innerHTML = Math.exp(b);
</script>
</body>
</html>
|
FUNCTION THAT MAY ASSIST IN TESTING WHETHER FEATURE IS SUPPORTED:
function isSupportedJavaScriptMethodMathExp() {
var z = 12.5; return !!Math.exp(z);
} |
NAVIGATION LINKS
Contents | Prev | Next | JavaScript Numbers and Math