当前位置:优草派 > 问答 > Python问答

Python中exp函数有什么用?

标签: Python  python函数  python库  作者: 罗西汉

回答:

在python之中exp函数不是内置函数,它是math这个数学计算模块内的一个方法。它的语法为math.exp(x),其中x是数值表达式,就是任意类型的数字。它的作用是返回括号内参数的指数,具体使用方法如下:

import math # 导入模块才能使用
# 调用exp函数并进行结果输出
print "math.exp(-45.17) : ", math.exp(-45.17)
print "math.exp(100.12) : ", math.exp(100.12)
2.41500621326e-20
3.03084361407e+43

TOP 10
  • 周排行
  • 月排行