Double.IsPositiveInfinity() Method in C# Last Updated : 13 Feb, 2019 Comments Improve Suggest changes Like Article Like Report In C#, Double.IsPositiveInfinity() is a Double struct method. This method is used to check whether a specified value evaluates to positive infinity or not. In some floating point operation, it is possible to obtain a result that is positive infinity. For Example: If any positive value is divided by zero, it results in positive infinity. Syntax: public static bool IsPositiveInfinity (double d); Parameter: d: It is a double-precision floating-point number of type System.Double. Return Type: This function return a Boolean value True, if specified value evaluates to positive infinity, otherwise return False. Example: Input : d = 10 / 0.0 Output : True Input : d = 7.997e307 + 9.985e307; Output : True Code: To demonstrate the Double.IsPositiveInfinity(Double) Method CSHARP // C# program to illustrate the // Double.IsPositiveInfinity() Method using System; class GFG { // Main method static public void Main() { // Dividing a Positive number by zero // results in positive infinity. // Dividing a number directly by 0 // produces an error // So 0 is stored in a variable first double zero = 0.0; double value = 10.0; double result = value / zero; // Printing result Console.WriteLine(result); // Check result using IsPositiveInfinity() Method Console.WriteLine(Double.IsPositiveInfinity(result)); // Floating point operation that exceeds // Double.MaxValue (i.e 1.7976931348623157E+308) // is Positive Infinity result = 7.997e307 + 9.985e307; // Printing result Console.WriteLine(result); // Check result using IsPositiveInfinity() Method Console.WriteLine(Double.IsPositiveInfinity(result)); } } Note: Floating-point operation return Infinity (Positive Infinity) or -Infinity (Negative Infinity) to indicate an overflow condition. The result of any floating point operation that exceeds Double.MaxValue (i.e 1.7976931348623157E+308 ) is considered as Positive Infinity. Comment More infoAdvertise with us Next Article Double.IsPositiveInfinity() Method in C# I ihritik Follow Improve Article Tags : C# CSharp-method CSharp-Double-Struct Similar Reads Double.IsNegativeInfinity() Method in C# In C#, Double.IsNegativeInfinity() is a Double struct method. This method is used to check whether a specified value evaluates to negative infinity or not. In some floating point operation, it is possible to obtain a result that is negative infinity. For Example: If any negative value is divided by 2 min read Double.IsInfinity() Method in C# In C#, Double.IsInfinity() is a Double struct method. This method is used to check whether a specified value evaluates to either positive infinity or negative infinity or not. While performing some mathematical operations, it is possible to obtain a result that is either positive infinity or negativ 2 min read Single.IsPositiveInfinity() Method in C# with Examples In C#, Single.IsPositiveInfinity(Single) is a Single struct method. This method is used to check whether a specified floating-point value evaluates to positive infinity or not. In some floating point operation, it is possible to obtain a result that is positive infinity. For Example: If any positive 2 min read Double.IsNaN() Method in C# In C#, Double.IsNaN() is a Double struct method. This method is used to check whether the specified value is not a number (NaN). Syntax: public static bool IsNaN (double d); Parameter: d: It is a double-precision floating-point number of type System.Double Return Type: This function returns a Boolea 2 min read Single.IsNegativeInfinity() Method in C# with Examples In C#, Single.IsNegativeInfinity(Single) is a Single struct method. This method is used to check whether a specified floating-point value evaluates to negative infinity or not. In some floating point operation, it is possible to obtain a result that is negative infinity. For Example: If any negative 2 min read Like