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 zero, it results in negative infinity.
Syntax: public static bool IsNegativeInfinity (double d);
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 negative infinity, otherwise return False.
Input : d = -5.0 / 0.0 Output : True Input : d = -1.5935e250 * 7.948e110 Output : True
Code: To demonstrate the Double.IsNegativeInfinity(Double) Method
-Infinity True -Infinity True
- The result of any floating point operation that is less than Double.MinValue (i.e -1.7976931348623157E+308 ) is considered as Negative Infinity.
- Floating-point operation return Infinity (Positive Infinity) or -Infinity (Negative Infinity) to indicate an overflow condition.
- Difference between Method Overriding and Method Hiding in C#
- C# | Insert() Method
- C# | Replace() Method
- C# | Clone() Method
- Decimal.Add() Method in C#
- C# | Math.Log() Method
- Stack.Pop() Method in C#
- C# | ToCharArray() Method
- C# | Random.Next() Method
- C# | IsNullOrWhiteSpace() Method
- Stack.Contains() Method in C#
- C# | PadRight() Method
- C# | Uri.ToString() Method
- C# | Uri.IsWellFormedOriginalString() Method
- C# | EndsWith() Method
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.