numeric_limits::max

유형에 대 한 최대 무한 값을 반환합니다.

static Type max( ) throw( );

반환 값

형식에 대해 최대 유한 값입니다.

설명

유한한 최대값 INT_MAX 형식입니다 int 및 FLT_MAX 형식에 대 한 float.반환 값은 의미가 경우 is_boundedtrue.

예제

// numeric_limits_max.cpp
// compile with: /EHsc
#include <iostream>
#include <limits>

using namespace std;

int main() {
   cout << "The maximum value for type float is:  "
        << numeric_limits<float>::max( )
        << endl;
   cout << "The maximum value for type double is:  "
        << numeric_limits<double>::max( )
        << endl;
   cout << "The maximum value for type int is:  "
        << numeric_limits<int>::max( )
        << endl;
   cout << "The maximum value for type short int is:  "
        << numeric_limits<short int>::max( )
        << endl;
}

Output

The maximum value for type float is:  3.40282e+038
The maximum value for type double is:  1.79769e+308
The maximum value for type int is:  2147483647
The maximum value for type short int is:  32767

요구 사항

헤더: <limits>

네임 스페이스: std

참고 항목

참조

strstreambuf Class