How to use expm1() function to get the exp (2.7182818) raised to the power N - 1 (exp(x) - 1) in Python

1 Answer

0 votes
import math

print(math.expm1(1))
print(math.expm1(-1))
print(math.expm1(0))
print(math.expm1(math.pi))
print(math.expm1(-0))
print(math.expm1(5))
print(math.expm1(0.5))
print(math.expm1(100))


'''
run:

1.718281828459045
-0.6321205588285577
0.0
22.140692632779267
0.0
147.4131591025766
0.6487212707001282
2.6881171418161356e+43

'''

 



answered Oct 12, 2017 by avibootz
...