Python | Decimal adjusted() method Last Updated : 05 Sep, 2019 Summarize Comments Improve Suggest changes Share Like Article Like Report Decimal#adjusted() : adjusted() is a Decimal class method which returns the adjusted exponent after shifting out the coefficient’s rightmost digits until only the lead digit remains Syntax: Decimal.adjusted() Parameter: Decimal values Return: the adjusted exponent after shifting out the coefficient’s rightmost digits until only the lead digit remains. Code #1 : Example for adjusted() method Python3 # Python Program explaining # adjusted() 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.adjusted() method print ("\n\nDecimal a with adjusted() method : ", a.adjusted()) print ("Decimal b with adjusted() method : ", b.adjusted()) Output : Decimal value a : -1 Decimal value b : 0.142857 Decimal a with adjusted() method : 0 Decimal b with adjusted() method : -1 Code #2 : Example for adjusted() method Python3 # Python Program explaining # adjusted() 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.adjusted() method print ("\n\nDecimal a with adjusted() method : ", a.adjusted()) print ("Decimal b with adjusted() method : ", b.adjusted()) Output : Decimal value a : -3.14 Decimal value b : 3.21E+7 Decimal a with adjusted() method : 0 Decimal b with adjusted() method : 7 Comment More infoAdvertise with us Next Article Python | Decimal as_tuple() method N noobestars101 Follow Improve Article Tags : Python Practice Tags : python Similar Reads Python | Decimal conjugate() method Decimal#conjugate() : conjugate() is a Decimal class method which returns the self, this method is only to comply with the Decimal Specification Syntax: Decimal.conjugate() Parameter: Decimal values Return: the self Decimal value Code #1 : Example for conjugate() method Python3 # Python Program expl 2 min read Python | Decimal compare() method Decimal#compare() : compare() is a Decimal class method which compares the two Decimal values. Syntax: Decimal.compare() Parameter: Decimal values Return: 1 - if a > b -1 - if a < b 0 - if a = b Code #1 : Example for compare() method Python3 # Python Program explaining # compare() method # loa 2 min read Python | Decimal copy_abs() method Decimal#copy_abs() : copy_abs() is a Decimal class method which returns the absolute Decimal value. Syntax: Decimal.copy_abs() Parameter: Decimal values Return: the absolute Decimal value Code #1 : Example for copy_abs() method Python3 # Python Program explaining # copy_abs() method # loading decima 2 min read Python | Decimal as_tuple() method Decimal#as_tuple() : as_tuple() is a Decimal class method which returns named tuple representation of the Decimal value. Syntax: Decimal.as_tuple() Parameter: Decimal values Return: tuple with values - sign - digits - exponent Code #1 : Example for as_tuple() method Python3 # Python Program explaini 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 | Decimal min() method Decimal#min() : min() is a Decimal class method which compares the two Decimal values and return the min of two. Syntax: Decimal.min() Parameter: Decimal values Return: the min of two. Code #1 : Example for min() method Python3 # Python Program explaining # min() method # loading decimal library fro 2 min read Like