Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

JavaScript exp() Method

JavaScript exp() Method

Math Object Reference JavaScript Math object

Example

Return the value of E raised to the power of x, where x is 1:

Math.exp(1);

Output result:

2.718281828459045

Try it »


Definition and Usage

The exp() method returns the value of e raised to the power of x. E is the base of the natural logarithm (approximately 2.7183).


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the exp() method


Syntax

Math.exp(

x

)

Parameter value

Parameters Description
x Required. A number

Return Value

Type Description
Number Returns e raised to the power of x. e represents the base of the natural logarithm, approximately 2.71828.

Technical Details

JavaScript version: 1.0

More examples

Example

In the following example, we will apply exp() to different values:

var a=Math.exp(-1);

var b=Math.exp(5);

var c=Math.exp(10);

a,b, and LinkedHashMap, among others. c Output result:

0.36787944117144233

148.4131591025766

22026.465794806718

Try it »


Math Object Reference JavaScript Math object