共用方式為


Single.PositiveInfinity 欄位

定義

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

public: float PositiveInfinity = Infinity;
public const float PositiveInfinity = Infinity;
val mutable PositiveInfinity : single
Public Const PositiveInfinity As Single  = Infinity

欄位值

Value = Infinity

範例

下列程式碼範例示範 PositiveInfinity 常數。

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

備註

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

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

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

適用於

另請參閱