PyDocs

Nav

Numeric and Mathematical Modules

expm1

math

function · Added in 3.2
  • expm1(x)
Return exp(x)-1.

This function avoids the loss of precision involved in the direct evaluation of exp(x)-1 for small x.
1 Example
>>> from math import exp, expm1
>>> exp(1e-5) - 1  # gives result accurate to 11 places
1.0000050000069649e-05
>>> expm1(1e-5)    # result accurate to full precision
1.0000050000166668e-05
from the Python docs
See Also
No see-alsos for math/expm1
0 Notes
No notes for expm1