以下是exp()方法的語法:
import math math.exp( x )
注意:此函數(shù)是無法直接訪問的,所以我們需要導(dǎo)入math模塊,然后需要用math的靜態(tài)對象來調(diào)用這個函數(shù)。
參數(shù)
x -- 這是一個數(shù)值表達(dá)式
返回值
此方法返回指數(shù)x: ex.
例子
下面的例子顯示了exp()方法的使用。
#!/usr/bin/python import math # This will import math module 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)
當(dāng)我們運(yùn)行上面的程序,它會產(chǎ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
【相關(guān)推薦】
1. 詳解Python中exp() 函數(shù)教程
2. 分享使用python編寫poc,exp的實(shí)例教程
聲明:本網(wǎng)頁內(nèi)容旨在傳播知識,若有侵權(quán)等問題請及時與本網(wǎng)聯(lián)系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com