Single.IsInfinity(Single) Metodo
Definizione
Restituisce un valore che indica se il numero specificato restituisce l'infinito negativo o positivo.Returns a value indicating whether the specified number evaluates to negative or positive infinity.
public:
static bool IsInfinity(float f);
public static bool IsInfinity (float f);
static member IsInfinity : single -> bool
Public Shared Function IsInfinity (f As Single) As Boolean
Parametri
- f
- Single
Numero a virgola mobile a precisione singola.A single-precision floating-point number.
Restituisce
true
se f
restituisce PositiveInfinity o NegativeInfinity; in caso contrario, false
.true
if f
evaluates to PositiveInfinity or NegativeInfinity; otherwise, false
.
Esempio
Nell'esempio di codice riportato di seguito viene illustrato il IsInfinity metodo.The following code example demonstrates the IsInfinity method.
// This will return S"true".
Console::WriteLine( "IsInfinity(3.0F / 0) == {0}.", Single::IsInfinity( 3.0F / zero ) ? (String^)"true" : "false" );
// This will return "true".
Console.WriteLine("IsInfinity(3.0F / 0) == {0}.", Single.IsInfinity(3.0F / 0) ? "true" : "false");
' This will return "True".
Console.Write("IsInfinity(3.0 / 0) = ")
If Single.IsPositiveInfinity(3 / 0) Then
Console.WriteLine("True.")
Else
Console.WriteLine("False.")
End If
Commenti
Le operazioni a virgola mobile restituiscono PositiveInfinity o NegativeInfinity per segnalare una condizione di overflow.Floating-point operations return PositiveInfinity or NegativeInfinity to signal an overflow condition.