exp函数 python

python如何引入exp函数

九三
615
2021-02-13 15:58:54
栏目: 编程语言

python如何引入exp函数

在python中引入exp函数的方法

在python使用exp函数时,需要先导入math模块

exp():exp()函数的功能是求e x e^{x}e x 的值。

exp()函数语法:

import math

math.exp( x )

exp()函数使用方法:

import math # 导入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(119L) : ", math.exp(119L)

print "math.exp(math.pi) : ", math.exp(math.pi)

输出结果为:

math.exp(-45.17) : 2.41500621326e-20

math.exp(100.12) : 3.03084361407e+43

math.exp(100.72) : 5.52255713025e+43

math.exp(119L) : 4.7978133273e+51

math.exp(math.pi) : 23.1406926328

0
看了该问题的人还看了