JavaScript & jQuery Tutorials

JS Home Right Arrow JS Reference Right Arrow Math Right Arrow exp()

exp()  Math  class method

Description

Returns the exponential value of a number - (Euler's constant and passed argument) Eargument.

  • Like all class methods exp() should be used on the class rather than an instance of the class.

Syntax


Signature Description
Math.exp(value)Returns the exponential value of a number - (Euler's constant and passed argument) Eargument.

Parameters


Parameter Description
valueThe value you wish to find the exponential value of:
  • Non-numeric strings returns NaN.
  • Passing no parameter returns NaN.
  • Passing null returns 1.

Examples

The code below displays exp() usage.


// Store results in an array.
var expValues = new Array(5);
expValues[0] = Math.exp(-1);
expValues[1] = Math.exp(0);
expValues[2] = Math.exp('0.75');
expValues[3] = Math.exp('a string');
expValues[4] = Math.exp();
expValues[5] = Math.exp(null);
alert(expValues);  

Press the button below to action the above code:

Related Tutorials

JavaScript Advanced Tutorials - Lesson 4 - Math



  

go to home page Homepage go to top of page Top