Single.IsNegativeInfinity(Single) 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(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
Parâmetros
- f
- Single
Um número de ponto flutuante de precisão simples.
Devoluções
true se f avalia a NegativeInfinity; caso contrário, false.
Implementações
Exemplos
O seguinte exemplo de código demonstra o IsNegativeInfinity método.
// 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
Observações
As operações em ponto flutuante retornam NegativeInfinity para sinalizar uma condição de transbordamento.