Export (0) Print
Expand All

Double.PositiveInfinity Field

Represents positive infinity. This field is constant.

[Visual Basic]
Public Const PositiveInfinity As Double
[C#]
public const double PositiveInfinity;
[C++]
public: const double PositiveInfinity;
[JScript]
public var PositiveInfinity : double;

Remarks

The value of this constant is the result of dividing a positive number by zero.

This constant is returned when the result of an operation is greater than MaxValue.

Use IsPositiveInfinity to determine whether a value evaluates to positive infinity. It is not possible to determine whether a value evaluates to positive infinity by comparing it to another value equal to PositiveInfinity.

Example

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

[Visual Basic] 
' This will equal Infinity.
Console.WriteLine("PositiveInfinity plus 10.0 equals " + (Double.PositiveInfinity + 10).ToString() + ".")

[C#] 
// This will equal Infinity.
Console.WriteLine("PositiveInfinity plus 10.0 equals {0}.", (Double.PositiveInfinity + 10.0).ToString());

[C++] 
// This will equal Infinity.
Console::WriteLine(S"PositiveInfinity plus 10.0 equals {0}.", __box((Double::PositiveInfinity + 10.0)));

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

Show:
© 2014 Microsoft