Double.IsInfinity Method

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

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

Namespace: System
Assembly: mscorlib (in mscorlib.dll)

Syntax

Public Shared Function IsInfinity ( _
    d As Double _
) As Boolean
public static bool IsInfinity(
    double d
)

Parameters

Return Value

Type: System..::.Boolean
true if d evaluates to PositiveInfinity or NegativeInfinity; otherwise, false.

Remarks

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

Examples

The following example illustrates the use of IsInfinity:

' This will return "True".
outputBlock.Text &= "IsInfinity(3.0 / 0) = "
If Double.IsPositiveInfinity(3 / 0) Then
   outputBlock.Text &= "True." & vbCrLf
Else
   outputBlock.Text &= "False." & vbCrLf
End If
// This will return "true".
outputBlock.Text += String.Format("IsInfinity(3.0 / 0) == {0}.", Double.IsInfinity(3.0 / 0) ? "true" : "false") + "\n";

Version Information

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Platforms

Windows Phone

See Also

Reference

Double Structure

System Namespace

IsPositiveInfinity

IsNegativeInfinity

PositiveInfinity

NegativeInfinity