How to use exp in JavaScript

In this article, I will explain use of exp() method in JavaScript.
  • 1613

JavaScript exp() Method

exp() method of math object returns the value of Ex, where

  • E is the Euler's constant number which approximately 2.7183
  • x is the number passed to it.

Syntax

Math.exp(x)

  • x is a Required number, and number represent

Example

In the following example show to exp() method returns the exponential value of numbers.

<html>

<head>

<title>JavaScript Math exp() Method</title>

</head>

<body>

<h3 style="color:Blue">JavaScript exp() Method Example</h3>

<script type="text/javascript">

    var a = Math.exp(5);

    document.write("First Value of exp : " + a);

    var b = Math.exp(60);

    document.write("<br />Second Value of exp : " + b);

    var c = Math.exp(-5);

    document.write("<br />Third Value of exp : " + c);

    var d = Math.exp(.9);

    document.write("<br />Fourth Value of exp : " + d);

</script>

</body>

</html>

Output

exp method.jpg

You may also want to read these related articles here

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here

Categories

More Articles

© 2020 DotNetHeaven. All rights reserved.