import math
print(math.exp(5)) # 148.4131591025766
print(math.exp(0)) # 1.0
Using negative number
import math
print(math.exp(-34.11)) # 1.5353776777478691e-15
print(math.exp(-34.99)) # 6.368484237071642e-16
print(math.exp(-34)) # 1.713908431542013e-15
import math
print(math.e ** -34.11) # 1.5353776777478719e-15
e : is a numerical constant of value equal to 2.71828 import math
x = 5
print(math.exp(math.log(x))) # Output: 5.0
Output:
5.0
import math
initial_value = 100
decay_rate = 0.05
time = 10
decayed_value = initial_value * math.exp(-decay_rate * time)
print(decayed_value) # Output: 60.653065971263345
Output:
60.653065971263345
Author
🎥 Join me live on YouTubePassionate about coding and teaching, I publish practical tutorials on PHP, Python, JavaScript, SQL, and web development. My goal is to make learning simple, engaging, and project‑oriented with real examples and source code.