Export (0) Print
Expand All

Double.IsNegativeInfinity Method

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

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

Parameters

d
A double-precision floating point number.

Return Value

true if d evaluates to NegativeInfinity; otherwise, false.

Remarks

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

Example

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

[Visual Basic] 
' This will return "True".
Console.Write("IsNegativeInfinity(-5.0 / 0) = ")
If Double.IsNegativeInfinity(-5 / 0) Then
    Console.WriteLine("True.")
Else
    Console.WriteLine("False.")
End If
    . . . 
If D > Double.MaxValue Then
    Console.WriteLine("Your number is bigger than a double.")
End If
    . . . 
' This will equal Infinity.
Console.WriteLine("10.0 minus NegativeInfinity equals " + (10 - Double.NegativeInfinity).ToString() + ".")

[C#] 
// This will return "true".
Console.WriteLine("IsNegativeInfinity(-5.0 / 0) == {0}.", Double.IsNegativeInfinity(-5.0 / 0) ? "true" : "false");
    . . . 
if (d > Double.MaxValue) 
{
    Console.WriteLine("Your number is bigger than a double.");
}
    . . . 
// This will equal Infinity.
Console.WriteLine("10.0 minus NegativeInfinity equals {0}.", (10.0 - Double.NegativeInfinity).ToString());

[C++] 
// This will return S"true".
Console::WriteLine(S"IsNegativeInfinity(-5.0 / 0) == {0}.", Double::IsNegativeInfinity(-5.0 / zero) ? S"true" : S"false");
 . . . 
if (d > Double::MaxValue) {
   Console::WriteLine(S"Your number is bigger than a double.");
}
 . . . 
// This will equal Infinity.
Console::WriteLine(S"10.0 minus NegativeInfinity equals {0}.", __box((10.0 - Double::NegativeInfinity)));

[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 | IsInfinity | IsPositiveInfinity | PositiveInfinity | NegativeInfinity

Show:
© 2014 Microsoft