In C#, Single.IsInfinity(Single) is a Single struct method. This method is used to check whether a specified floating-point 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 negative infinity. For Example: If any positive value is divided by zero, it results in positive infinity.
Syntax: public static bool IsInfinity (float f);
<emf: It is a single-precision floating-point number of type System.Single.
Return Type: This method return a boolean value True, if the specified value evaluates to either positive infinity or negative infinity, otherwise return False.
Infinity True Infinity True -Infinity True
Note: Floating-point operations return PositiveInfinity or NegativeInfinity to signal an overflow condition.
- Difference between Method Overriding and Method Hiding in C#
- C# | Math.Max() Method
- C# | Method Parameters
- C# | IsNullOrWhiteSpace() Method
- C# | PadLeft() Method
- C# | Join() Method | Set - 1
- C# | Uri.IsBaseOf(Uri) Method
- C# | Math.Min() Method
- C# | Math.Tan() Method
- Decimal.Add() Method in C#
- C# | String.Contains() Method
- C# | Uri.IsHexDigit() Method
- C# | Math.Exp() Method
- C# | Dictionary.Add() Method
- C# | Math.Abs() Method | Set - 1
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.