Double.IsNegativeInfinity(Double) Método
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
Devolve um valor que indica se o número especificado se avalia até menos infinito.
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
Parâmetros
- d
- Double
Um número de ponto flutuante de dupla precisão.
Devoluções
true se d avalia a NegativeInfinity; caso contrário, false.
Exemplos
O exemplo de código a seguir ilustra o uso de 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() + ".")
Observações
As operações em ponto flutuante retornam NegativeInfinity para sinalizar uma condição de transbordamento.