Python | Decimal normalize() method Last Updated : 17 Sep, 2019 Comments Improve Suggest changes Like Article Like Report Decimal#normalize() : normalize() is a Decimal class method which returns the simplest form of the Decimal value. Syntax: Decimal.normalize() Parameter: Decimal values Return: the simplest form of the Decimal value. Code #1 : Example for normalize() method Python3 # Python Program explaining # normalize() 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.normalize() method print ("\n\nDecimal a with normalize() method : ", a.normalize()) print ("Decimal b with normalize() method : ", b.normalize()) Output : Decimal value a : -1 Decimal value b : 0.142857 Decimal a with normalize() method : -1 Decimal b with normalize() method : 0.142857 Code #2 : Example for normalize() method Python3 # Python Program explaining # normalize() 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.normalize() method print ("\n\nDecimal a with normalize() method : ", a.normalize()) print ("Decimal b with normalize() method : ", b.normalize()) Output : Decimal value a : -3.14 Decimal value b : 3.21E+7 Decimal a with normalize() method : -3.14 Decimal b with normalize() method : 3.21E+7 Comment More infoAdvertise with us Next Article Python | Decimal normalize() method N noobestars101 Follow Improve Article Tags : Python Python-Functions Practice Tags : pythonpython-functions Similar Reads Python | Decimal is_normal() method Decimal#is_normal() : is_normal() is a Decimal class method which checks whether the Decimal value is a normal finite number. Syntax: Decimal.is_normal() Parameter: Decimal values Return: true - if the Decimal value is a normal finite number; otherwise false Code #1 : Example for is_normal() method 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 Python | Decimal is_nan() method Decimal#is_nan() : is_nan() is a Decimal class method which checks whether the Decimal value is NaN value. Syntax: Decimal.is_nan() Parameter: Decimal values Return: true - if the Decimal value is NaN value; otherwise false Code #1 : Example for is_nan() method Python3 # Python Program explaining # 2 min read Python | Decimal min_mag() method Decimal#min_mag() : min_mag() is a Decimal class method which compares the two Decimal values and return the minimum of two, with their sign ignored. Syntax: Decimal.min_mag() Parameter: Decimal values Return: minimum of two, with their sign ignored. Code #1 : Example for min_mag() method Python3 # 2 min read Python | Decimal copy_negate() method Decimal#copy_negate() : copy_negate() is a Decimal class method which returns the negation of Decimal value. Syntax: Decimal.copy_negate() Parameter: Decimal values Return: the negation of Decimal value Code #1 : Example for copy_negate() method Python3 # Python Program explaining # copy_negate() me 2 min read Like