Latest web development tutorials

() Fungsi Python3 exp

Python3 digital Python3 digital


deskripsi

exp () metode mengembalikan indeks x, e x.


tatabahasa

Berikut ini adalah metode sintaks exp ():

import math

math.exp( x )

Catatan: exp () tidak langsung dapat diakses, kita perlu mengimpor modul matematika, memanggil metode melalui objek statis.


parameter

  • x - ekspresi numerik.

Kembali Nilai

Kembali eksponen x, e x.

contoh

Berikut ini mengilustrasikan penggunaan exp () metode Contoh:

#!/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))

Setelah menjalankan contoh di atas output:

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 digital Python3 digital