Single.IsNegativeInfinity(Single) Single.IsNegativeInfinity(Single) Single.IsNegativeInfinity(Single) Single.IsNegativeInfinity(Single) Method

定义

返回一个值,通过该值指示指定数字是否计算为负无穷大。Returns a value indicating whether the specified number evaluates to negative infinity.

public:
 static bool IsNegativeInfinity(float f);
public static bool IsNegativeInfinity (float f);
static member IsNegativeInfinity : single -> bool
Public Shared Function IsNegativeInfinity (f As Single) As Boolean

参数

f
Single Single Single Single

单精度浮点数。A single-precision floating-point number.

返回

如果 f 的计算结果为 NegativeInfinity,则为 true;否则为 falsetrue if f evaluates to NegativeInfinity; otherwise, false.

示例

下面的代码示例演示了IsNegativeInfinity方法。The following code example demonstrates the IsNegativeInfinity method.

// This will return true.
Console::WriteLine( "IsNegativeInfinity(-5.0F / 0) == {0}.", Single::IsNegativeInfinity(  -5.0F / zero ) ? (String^)"true" : "false" );
// This will return true.
Console.WriteLine("IsNegativeInfinity(-5.0F / 0) == {0}.", Single.IsNegativeInfinity(-5.0F / 0) ? "true" : "false");
' This will return True.
Console.Write("IsNegativeInfinity(-5.0 / 0) = ")
If Single.IsNegativeInfinity(-5 / 0) Then
    Console.WriteLine("True.")
Else
    Console.WriteLine("False.")
End If

注解

浮点运算返回NegativeInfinity发出信号的溢出条件。Floating-point operations return NegativeInfinity to signal an overflow condition.

适用于

另请参阅