numeric_limits::is_bounded
測試,如果型別可以表示的一組值會受到限制。
static const bool is_bounded = false;
傳回值
true ,如果型別具有有界集合能顯示的值; false 。
備註
所有預先定義的型別具有有界集合能顯示的值並傳回 true。
範例
// numeric_limits_is_bounded.cpp
// compile with: /EHsc
#include <iostream>
#include <limits>
using namespace std;
int main( )
{
cout << "Whether float objects have bounded set "
<< "of representable values: "
<< numeric_limits<float>::is_bounded
<< endl;
cout << "Whether double objects have bounded set "
<< "of representable values: "
<< numeric_limits<double>::is_bounded
<< endl;
cout << "Whether long int objects have bounded set "
<< "of representable values: "
<< numeric_limits<long int>::is_bounded
<< endl;
cout << "Whether unsigned char objects have bounded set "
<< "of representable values: "
<< numeric_limits<unsigned char>::is_bounded
<< endl;
}
需求
標題: <。>
命名空間: std