Double.IsNegativeInfinity Method

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

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

Syntax

'Declaration
Public Shared Function IsNegativeInfinity ( _
    d As Double _
) As Boolean
public static bool IsNegativeInfinity(
    double d
)

Parameters

  • d
    Type: System.Double
    A double-precision floating-point number.

Return Value

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

Remarks

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

Examples

The following example illustrates the use of IsNegativeInfinity:

' This will return "True".
outputBlock.Text &= "IsNegativeInfinity(-5.0 / 0) = "
If Double.IsNegativeInfinity(-5 / 0) Then
   outputBlock.Text &= "True." & vbCrLf
Else
   outputBlock.Text &= "False." & vbCrLf
End If


...


If D > Double.MaxValue Then
   outputBlock.Text &= "Your number is bigger than a double." & vbCrLf
End If


...


' This will equal Infinity.
outputBlock.Text &= "10.0 minus NegativeInfinity equals " + (10 - Double.NegativeInfinity).ToString() + "." & vbCrLf
// This will return "true".
outputBlock.Text += String.Format("IsNegativeInfinity(-5.0 / 0) == {0}.", Double.IsNegativeInfinity(-5.0 / 0) ? "true" : "false") + "\n";


...


if (d > Double.MaxValue)
{
   outputBlock.Text += "Your number is bigger than a double." + "\n";
}


...


// This will equal Infinity.
outputBlock.Text += String.Format("10.0 minus NegativeInfinity equals {0}.", (10.0 - Double.NegativeInfinity).ToString()) + "\n";

Version Information

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Xbox 360, Windows Phone OS 7.0

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.