Double.IsNegativeInfinity(Double) Metodo

Definizione

Restituisce un valore che indica se il numero specificato restituisce un infinito negativo.

public:
 static bool IsNegativeInfinity(double d);
public static bool IsNegativeInfinity(double d);
static member IsNegativeInfinity : double -> bool
Public Shared Function IsNegativeInfinity (d As Double) As Boolean

Parametri

d
Double

Numero a virgola mobile e precisione doppia.

Valori restituiti

true se d restituisce NegativeInfinity; in caso contrario, false.

Esempio

Nell'esempio di codice seguente viene illustrato l'uso di IsNegativeInfinity:

// This will return "true".
Console.WriteLine("IsNegativeInfinity(-5.0 / 0) == {0}.", Double.IsNegativeInfinity(-5.0 / 0) ? "true" : "false");
// This will return "true".
printfn $"IsNegativeInfinity(-5.0 / 0) = {Double.IsNegativeInfinity(-5. / 0.)}."
' This will return "True".
Console.Write("IsNegativeInfinity(-5.0 / 0) = ")
If Double.IsNegativeInfinity(-5 / 0) Then
    Console.WriteLine("True.")
Else
    Console.WriteLine("False.")
End If
if (d > Double.MaxValue)
   Console.WriteLine("Your number is bigger than a double.");
if d > Double.MaxValue then
   printfn $"Your number is bigger than a double."
If D > Double.MaxValue Then
    Console.WriteLine("Your number is bigger than a double.")
End If
// This will equal Infinity.
Console.WriteLine("10.0 minus NegativeInfinity equals {0}.", (10.0 - Double.NegativeInfinity).ToString());
// This will equal Infinity.
printfn $"10.0 minus NegativeInfinity equals {10.0 - Double.NegativeInfinity}."
' This will equal Infinity.
Console.WriteLine("10.0 minus NegativeInfinity equals " + (10 - Double.NegativeInfinity).ToString() + ".")

Commenti

Le operazioni a virgola mobile restituiscono NegativeInfinity un segnale di una condizione di overflow.

Si applica a

Vedi anche