Double.IsPositiveInfinity(Double) Metod

Definition

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

public:
 static bool IsPositiveInfinity(double d);
public:
 static bool IsPositiveInfinity(double d) = System::Numerics::INumberBase<double>::IsPositiveInfinity;
public static bool IsPositiveInfinity(double d);
static member IsPositiveInfinity : double -> bool
Public Shared Function IsPositiveInfinity (d As Double) As Boolean

Parametrar

d
Double

Ett flyttal med dubbel precision.

Returer

trueom d utvärderas till PositiveInfinity, annars . false

Implementeringar

Exempel

Följande kodexempel illustrerar användningen av IsPositiveInfinity:

// This will return "true".
Console.WriteLine("IsPositiveInfinity(4.0 / 0) == {0}.", Double.IsPositiveInfinity(4.0 / 0) ? "true" : "false");
// This will return "true".
printfn $"IsPositiveInfinity(4.0 / 0) = %b{Double.IsPositiveInfinity(4. / 0.)}."
' This will return "True".
Console.Write("IsPositiveInfinity(4.0 / 0) = ")
If Double.IsPositiveInfinity(4 / 0) Then
    Console.WriteLine("True.")
Else
    Console.WriteLine("False.")
End If

Kommentarer

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

Gäller för

Se även