共用方式為


Double.PositiveInfinity 欄位

定義

表示正無限大。 這個欄位為常數。

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

欄位值

Value = Infinity

範例

下列程式碼範例說明 如何使用 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.
printfn $"PositiveInfinity plus 10.0 equals {Double.PositiveInfinity + 10.}."
' This will equal Infinity.
Console.WriteLine("PositiveInfinity plus 10.0 equals " + (Double.PositiveInfinity + 10).ToString() + ".")

備註

這個常數的值是將正數除以零的結果。

當作業的結果大於 Double.MaxValue 時,會傳回這個常數。

使用 IsPositiveInfinity 來判斷值是否評估為正無限大。

適用於

另請參閱