Udostępnij za pośrednictwem


numeric_limits::infinity

Reprezentacja nieskończoności dodatniej dla typu, jeżeli są dostępne.

static Type infinity( ) throw( );

Wartość zwracana

Reprezentacja nieskończoności dodatniej dla typu, jeżeli są dostępne.

Uwagi

Wartość zwracana ma znaczenie tylko wtedy, gdy has_infinity jest true.

Przykład

// 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;
}
  

Wymagania

Nagłówek:<limity>

Przestrzeń nazw: std

Zobacz też

Informacje

strstreambuf — Klasa