C# Single IsPositiveInfinity
Description
Single IsPositiveInfinity
returns a value indicating
whether the specified number evaluates to positive infinity.
Syntax
Single.IsPositiveInfinity
has the following syntax.
public static bool IsPositiveInfinity(
float f
)
Parameters
Single.IsPositiveInfinity
has the following parameters.
f
- A single-precision floating-point number.
Returns
Single.IsPositiveInfinity
method returns true if f evaluates to PositiveInfinity; otherwise, false.
Example
The following code example demonstrates the IsPositiveInfinity method.
/* w ww . java 2 s.c o m*/
using System;
public class MainClass{
public static void Main(String[] argv){
// This will return true.
Console.WriteLine("IsPositiveInfinity(4.0F / 0) == {0}.",
Single.IsPositiveInfinity(4.0F / 0) ? "true" : "false");
}
}
The code above generates the following result.