Double.IsPositiveInfinity Method
Returns a value indicating whether the specified number evaluates to positive infinity.
[Visual Basic] Public Shared Function IsPositiveInfinity( _ ByVal d As Double _ ) As Boolean [C#] public static bool IsPositiveInfinity( double d ); [C++] public: static bool IsPositiveInfinity( double d ); [JScript] public static function IsPositiveInfinity( d : double ) : Boolean;
Parameters
- d
- A double-precision floating point number.
Return Value
true if d evaluates to PositiveInfinity; otherwise, false.
Remarks
Floating-point operations return PositiveInfinity to signal an overflow condition.
Example
[Visual Basic, C#, C++] The following code sample illustrates the use of IsPositiveInfinity:
[Visual Basic] ' This will return "True". Console.Write("IsPositiveInfinity(4.0 / 0) = ") If Double.IsPositiveInfinity(4 / 0) Then Console.WriteLine("True.") Else Console.WriteLine("False.") End If [C#] // This will return "true". Console.WriteLine("IsPositiveInfinity(4.0 / 0) == {0}.", Double.IsPositiveInfinity(4.0 / 0) ? "true" : "false"); [C++] // This will return S"true". Console::WriteLine(S"IsPositiveInfinity(4.0 / 0) == {0}.", Double::IsPositiveInfinity(4.0 / 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
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
Double Structure | Double Members | System Namespace | IsInfinity | IsNegativeInfinity | PositiveInfinity | NegativeInfinity