JavaScript Math exp() Method Last Updated : 18 Apr, 2023 Comments Improve Suggest changes Like Article Like Report JavaScript Math.exp() is used to get the value of ep, where p is any given number. The number e is a mathematical constant having an approximate value equal to 2.718. It was discovered by the Swiss mathematician Jacob Bernoulli. 2.718 is also called Euler's number. Syntax: Math.exp(p) Parameter: This method accepts a single parameter p: It can be any number. Return Value: It returns the value of ep, where p is any given number as a parameter. Example: Input : Math.exp(0) Output : 1 Explanation: Here the value of parameter p is 0, So after putting the value 0 instead of p in ep then its value becomes 1. Input : Math.exp(2) Output : 7.38905609893065 Explanation: Here the value of parameter p is 2, So after putting the value 2 instead of p in ep then its value becomes 7.38905609893065. Below example illustrate the JavaScript Math exp() Method: Example 1: JavaScript // Here different values is being taken as // as parameter of Math.exp() function. console.log(Math.exp(0)); console.log(Math.exp(1)); console.log(Math.exp(2)); console.log(Math.exp(-1)); console.log(Math.exp(-7)); console.log(Math.exp(10)); console.log(Math.exp(1.2)); Output1 2.718281828459045 7.38905609893065 0.36787944117144233 0.0009118819655545162 22026.465794806718 3.3201169227365472 Example 2: Here parameter should be a number otherwise it gives an error or NaN i.e, not a number. JavaScript <script> // Here alphabet parameter give error. console.log(Math.exp(a)); </script> Output: Error: a is not defined JavaScript // Here parameter as a string give NaN. console.log(Math.exp("gfg")); OutputNaN Example -3 : If we don't pass any parameter to the method then it will also return NaN. JavaScript // Without passing any parameter console.log(Math.exp()); OutputNaN Supported Browsers: The browsers supported by JavaScript Math.E() function are listed below: Google Chrome 1 and aboveInternet Explorer 3 and aboveEdge 12 and aboveFirefox 1 and aboveOpera 3 and aboveSafari 1 and above We have a complete list of Javascript Math Objects methods, to check those please go through this Javascript Math Object Complete reference article. Comment More infoAdvertise with us Next Article JavaScript Math exp() Method K Kanchan_Ray Follow Improve Article Tags : Mathematical JavaScript Web Technologies DSA javascript-math +1 More Practice Tags : Mathematical Similar Reads JavaScript Math expm1() Method Math.expm1() is an inbuilt method in JavaScript that is used to get the value of ep-1, where p is any given number. The number e is a mathematical constant having an approximate value equal to 2.718. It was discovered by the Swiss mathematician Jacob Bernoulli. This number is also called Euler's num 3 min read JavaScript Math pow() Method The Math. pow() method is used to power a number i.e., the value of the number raised to some exponent. Since Math.pow() is a static method of Math, it is always used as Math.pow() and not as a method of an object created in Math class. Syntax:Math.pow(base, exponent)Parameters:base: It is the base 2 min read JavaScript Math log() Method The JavaScript Math log( ) Method is used to return the natural logarithm (base e) of a number. The JavaScript Math.log() method is equivalent to ln(x) in mathematics. If the value of x is negative, then the math.log() method return NaN. The log() is a static method of Math, therefore, it is always 3 min read JavaScript Math log2() Method The Javascript Math.log2() is an inbuilt method in JavaScript that gives the value of base 2 logarithms of any number. Syntax: Math.log2(p)Parameters: This method accepts a single parameter p which is any number whose base 2 logarithms is to be calculated.Returns: It returns the value of base 2 loga 3 min read JavaScript Math log1p() Method Javascript Math.log1p() is an inbuilt function in JavaScript that gives the value of the natural logarithm of 1 + p number. The natural logarithm is of base e, where e is an irrational and transcendental number approximately equal to 2.718. Syntax:Math.log1p(1 + p)Below example illustrate the JavaSc 4 min read p5.js exp() Method The exp() function returns the value of n (any number) to the Euler's number e(2.71828...) raised to the power n (e^n). Syntax: exp(n) Parameters: This method accepts a single parameters n i.e. the number value. Return Value: It returns (e^n) of the given number. Example 1: JavaScript function setu 2 min read Java Math addExact(long x, long y) method The java.lang.Math.addExact() is a built-in math function in java which returns the sum of its arguments. It throws an exception if the result overflows a long.As addExact(long x, long y) is static, so object creation is not required. Syntax : public static long addExact(long x, long y) Parameter : 1 min read Java multiplyExact() in Math The java.lang.Math.multiplyExact() is a built-in math function in java that returns the product of the arguments.It throws an exception if the result overflows an int. As multiplyExact(int a, int b) is static, so object creation is not required. Syntax: public static int multiplyExact(int a, int b) 2 min read math.pow() in Python In Python, math.pow() is a function that helps you calculate the power of a number. It takes two numbers as input: the base and the exponent. It returns the base raised to the power of the exponent.In simple terms, if you want to find "x raised to the power y", you can use math.pow(x, y).Example:Pyt 3 min read Like