Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Double.IsInfinity Method

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

[Visual Basic]
Public Shared Function IsInfinity( _
   ByVal d As Double _
) As Boolean
[C#]
public static bool IsInfinity(
 double d
);
[C++]
public: static bool IsInfinity(
 double d
);
[JScript]
public static function IsInfinity(
   d : double
) : Boolean;

Parameters

d
A double-precision floating point number.

Return Value

true if d evaluates to PositiveInfinity or NegativeInfinity; otherwise, false.

Remarks

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

Example

[Visual Basic, C#, C++] The following code sample illustrates the use of IsInfinity:

[Visual Basic] 
' This will return "True".
Console.Write("IsInfinity(3.0 / 0) = ")
If Double.IsPositiveInfinity(3 / 0) Then
    Console.WriteLine("True.")
Else
    Console.WriteLine("False.")
End If

[C#] 
// This will return "true".
Console.WriteLine("IsInfinity(3.0 / 0) == {0}.", Double.IsInfinity(3.0 / 0) ? "true" : "false");

[C++] 
// This will return S"true".
Console::WriteLine(S"IsInfinity(3.0 / 0) == {0}.", Double::IsInfinity(3.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 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

Double Structure | Double Members | System Namespace | IsPositiveInfinity | IsNegativeInfinity | PositiveInfinity | NegativeInfinity

Show:
© 2014 Microsoft