Python3 exp() 関数

Python3 数値


説明

exp() メソッドは e の x 乗(e^x)を返します。x。


構文

以下は exp() メソッドの構文です:

import math

math.exp( x )

注意:exp() は直接アクセスできず、math モジュールをインポートして、静的オブジェクトを介してこのメソッドを呼び出す必要があります。


引数

  • x -- 数値式。

戻り値

e の x 乗(e^x)を返します。x。

例

以下に exp() メソッドの使用例を示します:

#!/usr/bin/python3
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(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

Python3 数値

その他の拡張