Python | Decimal exp() method Last Updated : 05 Sep, 2019 Comments Improve Suggest changes Like Article Like Report Decimal#exp() : exp() is a Decimal class method which returns the value of the (natural) exponential function e**x at the given number Syntax: Decimal.exp() Parameter: Decimal values Return: the value of the (natural) exponential function e**x at the given number Code #1 : Example for exp() method Python3 # Python Program explaining # exp() method # loading decimal library from decimal import * # Initializing a decimal value a = Decimal(-1) b = Decimal('0.142857') # printing Decimal values print ("Decimal value a : ", a) print ("Decimal value b : ", b) # Using Decimal.exp() method print ("\n\nDecimal a with exp() method : ", a.exp()) print ("Decimal b with exp() method : ", b.exp()) Output : Decimal value a : -1 Decimal value b : 0.142857 Decimal a with exp() method : 0.3678794411714423215955237702 Decimal b with exp() method : 1.153564830100120253802476512 Code #2 : Example for exp() method Python3 # Python Program explaining # exp() method # loading decimal library from decimal import * # Initializing a decimal value a = Decimal('-3.14') b = Decimal('7.555') # printing Decimal values print ("Decimal value a : ", a) print ("Decimal value b : ", b) # Using Decimal.exp() method print ("\n\nDecimal a with exp() method : ", a.exp()) print ("Decimal b with exp() method : ", b.exp()) Output : Decimal value a : -3.14 Decimal value b : 7.555 Decimal a with exp() method : 0.04328279790196590079772976615 Decimal b with exp() method : 1910.270243928773816178935745 Comment More infoAdvertise with us Next Article Python | Decimal exp() method N noobestars101 Follow Improve Article Tags : Python Practice Tags : python Similar Reads Python | Decimal max() method Decimal#max() : max() is a Decimal class method which compares the two Decimal values and return the max of two. Syntax: Decimal.max() Parameter: Decimal values Return: the max of two. Code #1 : Example for max() method Python3 # Python Program explaining # max() method # loading decimal library fro 2 min read Python | Decimal ln() method Decimal#ln() : ln() is a Decimal class method which returns the natural (base e) logarithm of the Decimal value. Syntax: Decimal.ln() Parameter: Decimal values Return: the natural (base e) logarithm of the Decimal value. Code #1 : Example for ln() method Python3 # Python Program explaining # ln() me 2 min read Python | cmath.exp() method With the help of cmath.exp() method, we can find the exponent of any number by passing it to cmath.exp() method. Syntax : cmath.exp(value) Return : Return the exponential value. Example #1 : In this example we can see that by using cmath.exp() method, we are able to get the values of exponent by pas 1 min read Python | Decimal logb() method Decimal#logb() : logb() is a Decimal class method which returns the adjusted exponent of the Decimal value. Syntax: Decimal.logb() Parameter: Decimal values Return: the adjusted exponent of the Decimal value. Code #1 : Example for logb() method Python3 # Python Program explaining # logb() method # l 2 min read Python | Decimal log10() method Decimal#log10() : log10() is a Decimal class method which returns the base ten logarithm of the Decimal value. Syntax: Decimal.log10() Parameter: Decimal values Return: the base ten logarithm of the Decimal value. Code #1 : Example for log10() method Python3 # Python Program explaining # log10() met 2 min read Like