Home » JavaScript Tutorial

Math.exp() Method with Example in JavaScript

JavaScript | Math.exp() Method: Here, we are going to learn about the exp() method of Math class in JavaScript with Examples.
Submitted by Shivang Yadav, on December 06, 2019

JavaScript | Math.exp() Method

Math operations in JavaScript are handled using functions of math library in JavaScript. In this tutorial on Math.exp() method, we will learn about the exp() method and its working with examples.

Math.exp() is a function in math library of JavaScript that is used to find the value of ex of the number x, where x is the given value.

Syntax:

    Math.exp(x);

Parameter(s):

  • x – It represents the value whose ex value to be found.

Return value:

The return type of this method is number, it returns the ex of the given x.

Example 1: Passing numeric values to the function

console.log(Math.exp(1));
console.log(Math.exp(0));
console.log(Math.exp(-1));
console.log(Math.exp(-45));

Output

2.718281828459045
1
0.36787944117144233
2.8625185805493937e-20

Example 2: Passing non-numeric values to the function

console.log(Math.exp("Hello"));

Output

NaN






Comments and Discussions

Ad: Are you a blogger? Join our Blogging forum.




Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates


© https://www.includehelp.com some rights reserved.