Python | Decimal logb() method Last Updated : 05 Sep, 2019 Comments Improve Suggest changes Like Article Like Report 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 # loading decimal library from decimal import * # Initializing a decimal value a = Decimal('.9932') b = Decimal('0.142857') # printing Decimal values print ("Decimal value a : ", a) print ("Decimal value b : ", b) # Using Decimal.logb() method print ("\n\nDecimal a with logb() method : ", a.logb()) print ("Decimal b with logb() method : ", b.logb()) Output : Decimal value a : 0.9932 Decimal value b : 0.142857 Decimal a with logb() method : -1 Decimal b with logb() method : -1 Code #2 : Example for logb() method Python3 # Python Program explaining # logb() method # loading decimal library from decimal import * # Initializing a decimal value a = Decimal('3.14') b = Decimal('321e + 5') # printing Decimal values print ("Decimal value a : ", a) print ("Decimal value b : ", b) # Using Decimal.logb() method print ("\n\nDecimal a with logb() method : ", a.logb()) print ("Decimal b with logb() method : ", b.logb()) Output : Decimal value a : 3.14 Decimal value b : 3.21E+7 Decimal a with logb() method : 0 Decimal b with logb() method : 7 Comment More infoAdvertise with us Next Article Python | Decimal logb() method N noobestars101 Follow Improve Article Tags : Python Practice Tags : python Similar Reads 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 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.log() method With the help of cmath.log() method, we can find the value of log of any number having natural base value by passing it to cmath.log() method. Syntax : cmath.log(value) Return : Return the log value of natural base. Example #1 : In this example we can see that by using cmath.log() method, we are abl 1 min read Python | Decimal exp() method 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 P 2 min read Python | Decimal from_float() method Decimal#from_float() : from_float() is a Decimal class method which converts  a float to a decimal number, exactly. Syntax: Decimal.from_float() Parameter: Decimal values Return: converts  a float to a decimal number, exactly. Code #1 : Example for from_float() method Python3 # Python Program expla 2 min read Like