Python3中exp()函数用法分析
描述
exp()方法返回x的指数,ex。
语法
以下是exp()方法的语法:
importmath math.exp(x)
注意:exp()是不能直接访问的,需要导入math模块,通过静态对象调用该方法。
参数
x--数值表达式。
返回值
返回x的指数,ex。
实例
以下展示了使用exp()方法的实例:
#!/usr/bin/python3
importmath#导入math模块
print("math.exp(-45.17):",math.exp(-45.17))
print("math.exp(100.12):",math.exp(100.12))
print("math.exp(100.72):",math.exp(100.72))
print("math.exp(math.pi):",math.exp(math.pi))
以上实例运行后输出结果为:
math.exp(-45.17):2.4150062132629406e-20 math.exp(100.12):3.0308436140742566e+43 math.exp(100.72):5.522557130248187e+43 math.exp(math.pi):23.140692632779267
热门推荐
1 训练狗狗搜寻
2 如何训练狗狗装死
3 狗狗训练书
6 怎么训练狗狗拜年
8 狗狗训练游戏
10 狗狗嗅觉训练
11 怎么训练狗狗在笼子里不叫
12 怎么训练狗狗站立走路
13 怎么训练狗狗在马桶上
14 狗狗尿尿怎么训练
15 训练狗狗用品
16 泰迪狗狗的训练方法大小便
17 训练狗狗可以打吗
18 王曼丽的狗狗训练