numeric_limits::infinity
가능한 경우 형식에 대 한 양의 무한대의 표현입니다.
static Type infinity( ) throw( );
반환 값
가능한 경우 형식에 대 한 양의 무한대의 표현입니다.
설명
의미 있는 반환 값인 경우에만 has_infinity 입니다 true.
예제
// 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;
}
요구 사항
헤더: <limits>
네임 스페이스: std