numeric_limits::is_signed
測試,如果型別具有簽章的表示。
static const bool is_signed = false;
傳回值
true ,如果型別有已簽署的表示, false ,否則為。
備註
這個成員儲存適用於有已簽署的表示,是所有預先定義的浮點和帶正負號的整數(Unsigned Integer)型別的情況下的型別。
範例
// numeric_limits_is_signaled.cpp
// compile with: /EHsc
#include <iostream>
#include <limits>
using namespace std;
int main( )
{
cout << "Whether float objects have a signed representation: "
<< numeric_limits<float>::is_signed
<< endl;
cout << "Whether double objects have a signed representation: "
<< numeric_limits<double>::is_signed
<< endl;
cout << "Whether signed char objects have a signed representation: "
<< numeric_limits<signed char>::is_signed
<< endl;
cout << "Whether unsigned char objects have a signed representation: "
<< numeric_limits<unsigned char>::is_signed
<< endl;
}
需求
標題: <limits>
命名空間: std