Uređivanje

Dijeli putem


Single.IsNegativeInfinity(Single) Method

Definition

Returns a value indicating whether the specified number evaluates to negative infinity.

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

Parameters

f
Single

A single-precision floating-point number.

Returns

true if f evaluates to NegativeInfinity; otherwise, false.

Implements

Examples

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.
printfn $"IsNegativeInfinity(-5.0F / 0) == {Single.IsNegativeInfinity(-5f / 0f)}."
' 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

Remarks

Floating-point operations return NegativeInfinity to signal an overflow condition.

Applies to

See also