Double.PositiveInfinity 欄位

定義

表示正無限大。Represents positive infinity. 這個欄位是常數。This field is constant.

public: double PositiveInfinity = Infinity;
public const double PositiveInfinity = Infinity;
val mutable PositiveInfinity : double
Public Const PositiveInfinity As Double  = Infinity

欄位值

範例

下列程式碼範例說明如何使用 PositiveInfinityThe following code example illustrates the use of PositiveInfinity:

// This will equal Infinity.
Console::WriteLine( "PositiveInfinity plus 10.0 equals {0}.", (Double::PositiveInfinity + 10.0) );
// This will equal Infinity.
Console.WriteLine("PositiveInfinity plus 10.0 equals {0}.", (Double.PositiveInfinity + 10.0).ToString());
' This will equal Infinity.
Console.WriteLine("PositiveInfinity plus 10.0 equals " + (Double.PositiveInfinity + 10).ToString() + ".")

備註

這個常數的值是正數位除以零的結果。The value of this constant is the result of dividing a positive number by zero.

當運算的結果大於 Double.MaxValue時,就會傳回這個常數。This constant is returned when the result of an operation is greater than Double.MaxValue.

使用 IsPositiveInfinity 來判斷值是否評估為正無限大。Use IsPositiveInfinity to determine whether a value evaluates to positive infinity.

適用於

另請參閱