Python | Decimal is_qnan() method Last Updated : 05 Sep, 2019 Comments Improve Suggest changes Like Article Like Report Decimal#is_qnan() : is_qnan() is a Decimal class method which checks whether the Decimal value is quite NaN value. Syntax: Decimal.is_qnan() Parameter: Decimal values Return: true - if the Decimal value is quite NaN value; otherwise false Code #1 : Example for is_qnan() method Python3 # Python Program explaining # is_qnan() method # loading decimal library from decimal import * # Initializing a decimal value a = Decimal(-1) b = Decimal('nan') # printing Decimal values print ("Decimal value a : ", a) print ("Decimal value b : ", b) # Using Decimal.is_qnan() method print ("\n\nDecimal a with is_qnan() method : ", a.is_qnan()) print ("Decimal b with is_qnan() method : ", b.is_qnan()) Output : Decimal value a : -1 Decimal value b : NaN Decimal a with is_qnan() method : False Decimal b with is_qnan() method : True Code #2 : Example for is_qnan() method Python3 # Python Program explaining # is_qnan() 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.is_qnan() method print ("\n\nDecimal a with is_qnan() method : ", a.is_qnan()) print ("Decimal b with is_qnan() method : ", b.is_qnan()) Output : Decimal value a : -3.14 Decimal value b : 3.21E+7 Decimal a with is_qnan() method : False Decimal b with is_qnan() method : False Comment More infoAdvertise with us Next Article Python | Decimal is_qnan() method N noobestars101 Follow Improve Article Tags : Python Practice Tags : python Similar Reads Python | Decimal is_snan() method Decimal#is_snan() : is_snan() is a Decimal class method which checks whether the Decimal value is a signaling NaN Syntax: Decimal.is_snan() Parameter: Decimal values Return: true - if the Decimal value is a signaling NaN; otherwise false Code #1 : Example for is_snan() method Python3 # Python Progra 2 min read Python | Decimal is_signed() method Decimal#is_signed() : is_signed() is a Decimal class method which checks whether the sign of Decimal value is negative Syntax: Decimal.is_signed() Parameter: Decimal values Return: true - if the sign of Decimal value is negative; otherwise false Code #1 : Example for is_signed() method Python3 # Pyt 2 min read Python | Decimal is_subnormal() method Decimal#is_subnormal() : is_subnormal() is a Decimal class method which checks whether the Decimal value is subnormal. Syntax: Decimal.is_subnormal() Parameter: Decimal values Return: true - if the Decimal value is subnormal otherwise false Code #1 : Example for is_subnormal() method Python3 # Pytho 2 min read Python | Decimal is_zero() method Decimal#is_zero() : is_zero() is a Decimal class method which checks whether the Decimal value is zero value. Syntax: Decimal.is_zero() Parameter: Decimal values Return: true - if the Decimal value is zero value; otherwise false Code #1 : Example for is_zero() method Python3 # Python Program explain 2 min read Python | Decimal quantize() method decimal module helps you work with numbers that need high precision, like money or scientific calculations. quantize() method is used to round or format a decimal number to a specific number of decimal places while following a chosen rounding rule. For example, let's consider "n = 3.1459", when we a 3 min read Like