JavaScript expm1() method
- Previous Page exp()
- Next Page floor()
- Go to the Previous Level JavaScript Math Reference Manual
Definition and usage
expm1()
the method returns Ex The value minus 1, where E is Euler's number(approximately 2.7183),x is the number passed to it.
This method is more than using Math.exp() and subtract 1 for more accuracy.
Example
Example 1
Calculate the exponential value of a number - 1:
Math.expm1(3);
Example 2
Use the expm1() method for different numbers:
var a = Math.exp(1); var b = Math.exp(-1); var c = Math.exp(5); var d = Math.exp(10);
Syntax
Math.expm1(x)
Parameter value
Parameter | Description |
---|---|
x | Required. Number. |
Technical details
Return value: | Number, representing Ex - 1. |
---|---|
JavaScript version: | ECMAScript 2015 |
Browser Support
Methods | Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
expm1() | 38.0 | 12.0 | 25.0 | 8.0 | 25.0 |
Related Pages
Tutorial:JavaScript Math
- Previous Page exp()
- Next Page floor()
- Go to the Previous Level JavaScript Math Reference Manual