From http://www.w3schools.com (Copyright Refsnes Data)

JavaScript exp() Method


Math Object Reference JavaScript Math Object

Definition and Usage

The exp() method returns the value of Ex, where E is Euler's constant (approximately 2.7183) and x is the number passed to it.

Syntax

Math.exp(x)

Parameter Description
x Required. A number


Tips and Notes

Tip: E is the Euler's constant, which is the base of natural logarithms (approximately 2.7183).


Example

Example

Use the exp() method on different numbers:

<script type="text/javascript">

document.write(Math.exp(1) + "<br />");
document.write(Math.exp(-1) + "<br />");
document.write(Math.exp(5) + "<br />");
document.write(Math.exp(10) + "<br />");

</script>

The output of the code above will be:

2.718281828459045
0.36787944117144233
148.4131591025766
22026.465794806718

Try it yourself »


Math Object Reference JavaScript Math Object

From http://www.w3schools.com (Copyright Refsnes Data)