The Wayback Machine - https://web.archive.org/web/20230512160429/https://www.geeksforgeeks.org/javascript-math-exp-method/
Skip to content
Related Articles
Get the best out of our app
GeeksforGeeks App
Open App
geeksforgeeks
Browser
Continue

Related Articles

JavaScript Math exp() Method

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

The JavaScript Math exp( ) Method is used to return ex, where x is the argument, and e is Euler’s number, which is the base of the natural logarithms. The exp() is a static method of Math, therefore, it is always used as Math.exp(), rather than as a method of a Math object created.

Syntax:  

Math.exp(value)

Parameters Used: This function accepts a single parameter as mentioned above and described below:  

  • Value is a number whose ex you want to find.

Returns: The Math.exp() method returns ex where e is Euler’s number and x is the argument.

Below is an example of the Math exp() Method. 

Example 1: 

Javascript




<script type="text/javascript">
    console.log("When zero is passed as a parameter: "
            + Math.exp(0));
</script>

Output: 

When zero is  passed as a parameter: 1

Example 2: When “-1” is passed as a parameter.

Javascript




<script type="text/javascript">
    console.log("Result : " + Math.exp(-1));
</script>

Output: 

Result : 0.36787944117144233 

Example 3: When “1” is passed as a parameter. 

Javascript




<script type="text/javascript">
    console.log("Result : " + Math.exp(1));
</script>

Output: 

Result :  2.718281828459045 

We have a complete list of Javascript Math Objects methods, to check those please go through this Javascript Math Object Complete reference article.

Supported Browsers: 

  • Google Chrome 1 and above
  • Internet Explorer 3 and above
  • Firefox 1 and above
  • Opera 3 and above
  • Safari 1 and above

We have a Cheat Sheet on Javascript where we covered all the important topics of Javascript to check those please go through Javascript Cheat Sheet-A Basic guide to JavaScript.


My Personal Notes arrow_drop_up
Last Updated : 29 Nov, 2022
Like Article
Save Article
Similar Reads
Related Tutorials