Visit Mozilla.org

Core JavaScript 1.5 Reference:Global Objects:Math:exp

From MDC


Contents

[edit] Summary

Returns Ex, where x is the argument, and E is Euler's constant, the base of the natural logarithms.

Method of Math

Static

Implemented in: JavaScript 1.0, NES 2.0
ECMA Version: ECMA-262

[edit] Syntax

Math.exp(x)

[edit] Parameters

x 
A number.

[edit] Description

Because exp is a static method of Math, you always use it as Math.exp(), rather than as a method of a Math object you created.

[edit] Examples

[edit] Example: Using Math.exp

The following function returns the exponential value of the variable x:

function getExp(x) {
   return Math.exp(x)
}

If you pass getExp the value 1, it returns 2.718281828459045.

[edit] See Also

E, log, pow