JavaScript expm1() Method
More "Try it Yourself" examples below.
Definition and Usage
The expm1() method returns the value of Ex minus 1, where E is Euler's number (approximately 2.7183) and x is the number passed to it.
This method is more accurate than using Math.exp() and subtracting 1.
Browser Support
Method | |||||
---|---|---|---|---|---|
expm1() | 38.0 | 12.0 | 25.0 | 8.0 | 25.0 |
Syntax
Math.expm1(x)
Parameter Values
Parameter | Description |
---|---|
x | Required. A number |
Technical Details
Return Value: | A Number, representing Ex minus 1 |
---|---|
JavaScript Version: | ECMAScript 2015 |
More Examples
Example
Use the expm1() method on different numbers:
var a = Math.exp(1);
var b = Math.exp(-1);
var c = Math.exp(5);
var d = Math.exp(10);
Try it Yourself »