Export (0) Print
Expand All

Single.IsPositiveInfinity Method

Returns a value indicating whether the specified number evaluates to positive infinity.

[Visual Basic]
Public Shared Function IsPositiveInfinity( _
   ByVal f As Single _
) As Boolean
[C#]
public static bool IsPositiveInfinity(
 float f
);
[C++]
public: static bool IsPositiveInfinity(
 float f
);
[JScript]
public static function IsPositiveInfinity(
   f : float
) : Boolean;

Parameters

f
A single-precision floating point number.

Return Value

true if f evaluates to PositiveInfinity; otherwise, false.

Remarks

Floating-point operations return PositiveInfinity to signal an overflow condition.

Example

[Visual Basic, C#, C++] The following sample demonstrates the IsPositiveInfinity method.

[Visual Basic] 
' This will return True.
Console.Write("IsPositiveInfinity(4.0 / 0) = ")
If Single.IsPositiveInfinity(4 / 0) Then
    Console.WriteLine("True.")
Else
    Console.WriteLine("False.")
End If

[C#] 
// This will return true.
Console.WriteLine("IsPositiveInfinity(4.0F / 0) == {0}.", Single.IsPositiveInfinity(4.0F / 0) ? "true" : "false");

[C++] 
// This will return true.
Console::WriteLine(S"IsPositiveInfinity(4.0F / 0) == {0}.", Single::IsPositiveInfinity(4.0F / zero) ? S"true" : S"false");

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework, Common Language Infrastructure (CLI) Standard

See Also

Single Structure | Single Members | System Namespace | IsInfinity | IsNegativeInfinity | PositiveInfinity | NegativeInfinity

Show:
© 2014 Microsoft