新聞中心
這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
創(chuàng)新互聯(lián)Python教程:pythone怎么表示
exp()方法返回x的指數(shù),ex。

語法
以下是 exp() 方法的語法:
import math math.exp( x )
相關(guān)推薦:《python教程》
注意:exp()是不能直接訪問的,需要導(dǎo)入 math 模塊,通過靜態(tài)對象調(diào)用該方法。
參數(shù)
x -- 數(shù)值表達(dá)式。
返回值
返回x的指數(shù),ex。
實(shí)例
以下展示了使用 exp() 方法的實(shí)例:
#!/usr/bin/python import math # 導(dǎo)入 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)
以上實(shí)例運(yùn)行后輸出結(jié)果為:
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
網(wǎng)頁題目:創(chuàng)新互聯(lián)Python教程:pythone怎么表示
瀏覽路徑:http://fisionsoft.com.cn/article/cohpepp.html


咨詢
建站咨詢
