Single.IsNegativeInfinity(Single) Metod

Definition

Returnerar ett värde som anger om det angivna talet utvärderas till negativ oändlighet.

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

Parametrar

f
Single

Ett flyttal med enkel precision.

Returer

trueom f utvärderas till NegativeInfinity, annars . false

Implementeringar

Exempel

I följande kodexempel visas IsNegativeInfinity metoden.

// 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

Kommentarer

Flyttalsåtgärder återgår NegativeInfinity till att signalera ett spilltillstånd.

Gäller för

Se även