numeric_limits::infinity
Les performances de l'infini positif pour un type, le cas échéant.
static Type infinity( ) throw( );
Valeur de retour
Les performances de l'infini positif pour un type, le cas échéant.
Notes
La valeur de retour est utile uniquement si has_infinity est true.
Exemple
// numeric_limits_infinity.cpp
// compile with: /EHsc
#include <iostream>
#include <limits>
using namespace std;
int main( )
{
cout << numeric_limits<float>::has_infinity <<endl;
cout << numeric_limits<double>::has_infinity<<endl;
cout << numeric_limits<long double>::has_infinity <<endl;
cout << numeric_limits<int>::has_infinity <<endl;
cout << numeric_limits<__int64>::has_infinity <<endl;
cout << "The representation of infinity for type float is: "
<< numeric_limits<float>::infinity( ) <<endl;
cout << "The representation of infinity for type double is: "
<< numeric_limits<double>::infinity( ) <<endl;
cout << "The representation of infinity for type long double is: "
<< numeric_limits<long double>::infinity( ) <<endl;
}
Configuration requise
**En-tête :**limites <de >
Espace de noms : std