Single.IsPositiveInfinity(Single) Méthode
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Retourne une valeur indiquant si le nombre spécifié est équivalent à l'infini positif.
public:
static bool IsPositiveInfinity(float f);
public:
static bool IsPositiveInfinity(float f) = System::Numerics::INumberBase<float>::IsPositiveInfinity;
public static bool IsPositiveInfinity (float f);
static member IsPositiveInfinity : single -> bool
Public Shared Function IsPositiveInfinity (f As Single) As Boolean
Paramètres
- f
- Single
Nombre à virgule flottante simple précision.
Retours
true
si f
a la valeur PositiveInfinity ; sinon, false
.
Implémente
Exemples
L’exemple de code suivant illustre la IsPositiveInfinity méthode .
// This will return true.
Console::WriteLine( "IsPositiveInfinity(4.0F / 0) == {0}.", Single::IsPositiveInfinity( 4.0F / zero ) ? (String^)"true" : "false" );
// This will return true.
Console.WriteLine("IsPositiveInfinity(4.0F / 0) == {0}.", Single.IsPositiveInfinity(4.0F / 0) ? "true" : "false");
// This will return true.
printfn $"IsPositiveInfinity(4.0F / 0) == {Single.IsPositiveInfinity(4f / 0f)}."
' This will return True.
Console.Write("IsPositiveInfinity(4.0 / 0) = ")
If Single.IsPositiveInfinity(4 / 0) Then
Console.WriteLine("True.")
Else
Console.WriteLine("False.")
End If
Remarques
Les opérations à virgule flottante retournent PositiveInfinity pour signaler une condition de dépassement de capacité.
S’applique à
Voir aussi
Commentaires
https://aka.ms/ContentUserFeedback.
Bientôt disponible : Tout au long de 2024, nous allons supprimer progressivement GitHub Issues comme mécanisme de commentaires pour le contenu et le remplacer par un nouveau système de commentaires. Pour plus d’informations, consultezEnvoyer et afficher des commentaires pour