The exp(x) method returns the value of E^x, where E is Euler's number (approximately 2.7183).
The exp(x) method returns the value of E^x, where E is Euler's number (approximately 2.7183).
Math.exp(x)
Parameter | Require | Description |
---|---|---|
x | Required. | A number |
A Number, representing E^x
Return Ex, where x is 1
//display the result of Math.exp(1).
console.log(Math.exp(1));
Use the exp() method on different numbers:
//display the result of Math.exp() on different numbers. var a = Math.exp(-1); var b = Math.exp(5); var c = Math.exp(10); var x = a + "\n" + b + "\n" + c; console.log(x);//from www . j av a2 s . c o m