Python | Decimal is_infinite() method Last Updated : 05 Sep, 2019 Summarize Comments Improve Suggest changes Share Like Article Like Report Decimal#is_infinite() : is_infinite() is a Decimal class method which checks whether the Decimal value is infinite value. Syntax: Decimal.is_infinite() Parameter: Decimal values Return: true - if the Decimal value is infinite value; otherwise false Code #1 : Example for is_infinite() method Python3 # Python Program explaining # is_infinite() method # loading decimal library from decimal import * # Initializing a decimal value a = Decimal(-1) b = Decimal('-inf') # printing Decimal values print ("Decimal value a : ", a) print ("Decimal value b : ", b) # Using Decimal.is_infinite() method print ("\n\nDecimal a with is_infinite() method : ", a.is_infinite()) print ("Decimal b with is_infinite() method : ", b.is_infinite()) Output : Decimal value a : -1 Decimal value b : -Infinity Decimal a with is_infinite() method : False Decimal b with is_infinite() method : True Code #2 : Example for is_infinite() method Python3 # Python Program explaining # is_infinite() 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_infinite() method print ("\n\nDecimal a with is_infinite() method : ", a.is_infinite()) print ("Decimal b with is_infinite() method : ", b.is_infinite()) Output : Decimal value a : -3.14 Decimal value b : 3.21E+7 Decimal a with is_infinite() method : False Decimal b with is_infinite() method : False Comment More infoAdvertise with us Next Article Python | Decimal is_infinite() method N noobestars101 Follow Improve Article Tags : Python Practice Tags : python Similar Reads Python | Decimal is_finite() method Decimal#is_finite() : is_finite() is a Decimal class method which checks whether the Decimal value is finite value. Syntax: Decimal.is_finite() Parameter: Decimal values Return: true - if the Decimal value is finite value; otherwise false Code #1 : Example for is_finite() method Python3 # Python Pro 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 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 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 logical_invert() method Decimal#logical_invert() : logical_invert() is a Decimal class method which returns the digit-wise inversion of the Decimal values. Syntax: Decimal.logical_invert() Parameter: Decimal values Return: the digit-wise inversion of the Decimal values. Code #1 : Example for logical_invert() method Python3 2 min read Like