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

适用于

另请参阅