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 确定值的计算结果是否为正无穷大。

适用于

另请参阅