Python math.expm1() Method
Example
Find the exponential value of a number - 1:
#Import math Library
import math
#Return the exponential ex-1
print(math.expm1(32))
print(math.expm1(-10.89))
Try it Yourself »
Definition and Usage
The math.expm1() method returns the value of Ex
- 1, where E is Euler's number (approximately 2.718281...), and x is the number passed to it.
This function is more accurate than calling
math.exp() and subtracting 1.
Syntax
math.expm1(x)
Parameter Values
| Parameter | Description |
|---|---|
| x | Required. A number. If we try to find the exponential that is out the range of double it produces an error OverflowError |
Technical Details
| Return Value: | A float value, representing the
exponential - 1 of a number |
|---|---|
| Python Version: | 2.7 |


