IsNegativeInfinity Method

Double.IsNegativeInfinity 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 infinity.

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

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.

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

The following example illustrates the use of IsNegativeInfinity:


// 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";


Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2017 Microsoft